switch view map + web

This commit is contained in:
Thomas Fransolet 2021-02-22 22:03:21 +01:00
parent 9e457b5d02
commit 16ac760b96

View File

@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
import 'package:provider/provider.dart';
import 'package:tablet_app/Components/Map/map_context.dart';
import 'package:tablet_app/Components/Map/map_view.dart';
import 'package:tablet_app/Components/webView.dart';
import 'package:tablet_app/Models/map-marker.dart';
import 'package:tablet_app/Models/section.dart';
import 'package:tablet_app/constants.dart';
@ -46,8 +47,13 @@ class _MainViewWidget extends State<MainViewWidget> {
);
break;
case 1 : // WEB
elementToShow = WebViewWidget(url: 'Test');
break;
case 0 :
case 2 :
elementToShow = Text('Hellow in');
break;
default:
elementToShow = Text('Hellow default');
break;
}
return Scaffold(
@ -55,14 +61,14 @@ class _MainViewWidget extends State<MainViewWidget> {
children: [
Container(
width: size.width,
height: size.height * 0.15,
height: size.height * 0.10,
child: Row(
children: [
Padding(
padding: const EdgeInsets.only(left: 15.0, top: 10.0),
child: Container(
width: 150,
height: 150,
width: 125,
height: 125,
decoration: boxDecoration(sectionSelected),
),
),
@ -77,11 +83,11 @@ class _MainViewWidget extends State<MainViewWidget> {
children: [
Align(
alignment: Alignment.centerLeft,
child: Text(sectionSelected.title, style: new TextStyle(fontSize: 35))
child: Text(sectionSelected.title, style: new TextStyle(fontSize: 50))
),
Align(
alignment: Alignment.centerLeft,
child: Text(sectionSelected.description, style: new TextStyle(fontSize: 25)))
child: Text(sectionSelected.description, style: new TextStyle(fontSize: 35)))
],
),
)
@ -89,10 +95,10 @@ class _MainViewWidget extends State<MainViewWidget> {
),
),
Padding(
padding: const EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
padding: const EdgeInsets.only(left: 15.0, right: 15.0, top: 15.0),
child: Container(
width: size.width,
height: size.height * 0.822,
height: size.height * 0.87,
decoration: BoxDecoration(
color: kBackgroundLight,
shape: BoxShape.rectangle,
@ -106,14 +112,17 @@ class _MainViewWidget extends State<MainViewWidget> {
),
],
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: elementToShow),
),
)
],
),
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: Container(
height: 125.0,
width: 125.0,
height: 130.0,
width: 130.0,
child: FittedBox(
child: FloatingActionButton.extended(
onPressed: () {
@ -122,7 +131,7 @@ class _MainViewWidget extends State<MainViewWidget> {
});
},
icon: Icon(Icons.arrow_back),
label: Text("Menu"),
label: Text("Menu")
),
),
),
@ -204,7 +213,7 @@ class _MainViewWidget extends State<MainViewWidget> {
return [
new Section(id: 0, title: "TEST Map", description: "Ceci est l'essai d'une carte", image: "https://www.novo-monde.com/app/uploads/2017/11/novo-map-banner-3.jpg", category: 0),
new Section(id: 0, title: "TEST Site web", description: "Ceci est l'essai d'un site web", image: "https://static.wixstatic.com/media/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.jpg/v1/fill/w_892,h_564,al_c,q_85,usm_0.66_1.00_0.01/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.webp", category: 1),
new Section(id: 0, title: "TEST 2", description: "fsfsdf", image: "https://static.wixstatic.com/media/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.jpg/v1/fill/w_892,h_564,al_c,q_85,usm_0.66_1.00_0.01/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.webp", category: 0),
new Section(id: 0, title: "TEST 2", description: "fsfsdf", image: "https://static.wixstatic.com/media/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.jpg/v1/fill/w_892,h_564,al_c,q_85,usm_0.66_1.00_0.01/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.webp", category: 2),
new Section(id: 0, title: "TEST 3", description: "fsfsdf", image: "https://static.wixstatic.com/media/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.jpg/v1/fill/w_892,h_564,al_c,q_85,usm_0.66_1.00_0.01/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.webp", category: 0),
new Section(id: 0, title: "TEST 4", description: "fsfsdf", image: "https://static.wixstatic.com/media/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.jpg/v1/fill/w_892,h_564,al_c,q_85,usm_0.66_1.00_0.01/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.webp", category: 0),
new Section(id: 0, title: "TEST 5", description: "fsfsdf", image: "https://static.wixstatic.com/media/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.jpg/v1/fill/w_892,h_564,al_c,q_85,usm_0.66_1.00_0.01/38e2f4_4c1714f38942446e99c1e736726e4465~mv2.webp", category: 0),