From 5a7366a10df5c53cd887b679338daa5a2119a564 Mon Sep 17 00:00:00 2001 From: Sara <sarasdj@stud.ntnu.no> Date: Mon, 25 Mar 2024 14:36:05 +0100 Subject: [PATCH] update: add back AppBar --- app/lib/consts.dart | 1 + app/lib/pages/default_page.dart | 29 +++++++++++++++++++++++++++++ app/lib/widgets/choropleth_map.dart | 10 ++-------- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/app/lib/consts.dart b/app/lib/consts.dart index 69a50090..61d14d37 100644 --- a/app/lib/consts.dart +++ b/app/lib/consts.dart @@ -25,6 +25,7 @@ final titleStyle = GoogleFonts.chakraPetch( fontWeight: FontWeight.bold, ); final regTextStyle = GoogleFonts.chakraPetch(fontSize: 16, color: textColor); +final regTextStyleBig = GoogleFonts.chakraPetch(fontSize: 18, color: textColor); final chartTextStyle = GoogleFonts.chakraPetch(fontSize: 12, color: textColor); final subHeadingStyle = GoogleFonts.chakraPetch(fontSize: 18, color: textColor, fontWeight: FontWeight.bold); diff --git a/app/lib/pages/default_page.dart b/app/lib/pages/default_page.dart index 78be9cf7..8192e7b2 100644 --- a/app/lib/pages/default_page.dart +++ b/app/lib/pages/default_page.dart @@ -88,6 +88,35 @@ class _DefaultPageState extends State<DefaultPage> { Widget build(BuildContext context) { return MaterialApp( home: Scaffold( + appBar: AppBar( + backgroundColor: Colors.black87, + leading: IconButton( + icon: const Icon( + Icons.menu, + color: Colors.white54 + ), + onPressed: () { + // Not implemented + }, + ), + title: Text( + 'Mjøsa', + style: regTextStyleBig, + ), + actions: [ + IconButton( + icon: const Icon( + Icons.search, + color: Colors.white54 + ), + onPressed: () { + setState(() { + showBar = !showBar; + }); + }, + ), + ], + ), body: FutureBuilder( future: Future.wait([markerListFuture, relationFuture]), builder: (BuildContext context, AsyncSnapshot<List<dynamic>> snapshot) { diff --git a/app/lib/widgets/choropleth_map.dart b/app/lib/widgets/choropleth_map.dart index 2ab4eb52..a2bc6df7 100644 --- a/app/lib/widgets/choropleth_map.dart +++ b/app/lib/widgets/choropleth_map.dart @@ -51,12 +51,6 @@ class _ChoroplethMapState extends State<ChoroplethMap> { } }; - // ?Should the map be pre-divided into groups? - - // Parse relation to json - // Make a list of key value pairs (key: groupID, value: appended shapes) - // Parse back to Uint8list - // Initialise data source dataSource = MapShapeSource.memory( widget.relation, @@ -98,8 +92,8 @@ class _ChoroplethMapState extends State<ChoroplethMap> { SfMapsTheme( data: SfMapsThemeData( // Coloring of selected shape selectionColor: selectedColor, - selectionStrokeWidth: 3, - selectionStrokeColor: Colors.red[900], + selectionStrokeWidth: 3.5, + selectionStrokeColor: Colors.blue[600], ), child: SfMaps( layers: [ -- GitLab