From 16ac760b9656523b8496223db050b1dee079d1ea Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Mon, 22 Feb 2021 22:03:21 +0100 Subject: [PATCH] switch view map + web --- lib/Components/MainView/main_view.dart | 35 ++++++++++++++++---------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/lib/Components/MainView/main_view.dart b/lib/Components/MainView/main_view.dart index 9dfd2a2..0732592 100644 --- a/lib/Components/MainView/main_view.dart +++ b/lib/Components/MainView/main_view.dart @@ -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 { ); 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 { 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 { 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 { ), ), 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 { ), ], ), + 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 { }); }, icon: Icon(Icons.arrow_back), - label: Text("Menu"), + label: Text("Menu") ), ), ), @@ -204,7 +213,7 @@ class _MainViewWidget extends State { 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),