Skip to content
Snippets Groups Projects
Commit 74cc3cc4 authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

Update: set last lake from persistent storage

parent 645f1211
No related branches found
No related tags found
1 merge request!16Clhp map into main
...@@ -11,7 +11,6 @@ const String mapEndpoint = "update_map"; ...@@ -11,7 +11,6 @@ const String mapEndpoint = "update_map";
// Map variables // Map variables
String selectedLake = 'Mjøsa'; // NB should be initialised to last selected lake String selectedLake = 'Mjøsa'; // NB should be initialised to last selected lake
Uint8List selectedRelation = Uint8List(0); // Initialised in init_state.dart Uint8List selectedRelation = Uint8List(0); // Initialised in init_state.dart
List<Measurement> selectedMeasurements = []; List<Measurement> selectedMeasurements = [];
List<SubDiv> selectedSubdivisions = []; List<SubDiv> selectedSubdivisions = [];
......
...@@ -74,8 +74,12 @@ Future<void> initialiseState(bool fetchSearchOptions) async { ...@@ -74,8 +74,12 @@ Future<void> initialiseState(bool fetchSearchOptions) async {
initSearchOptions(); initSearchOptions();
} }
//selectedRelation = await relationFuture; // Last lake initialised to last persistent variable, or Mjøsa if the variable is not found
selectedRelation = await relationFuture; // NB update once fixed final prefs = await SharedPreferences.getInstance();
selectedLake = prefs.getString('lasLake') ?? "Mjøsa";
// Set the selected relation
selectedRelation = await relationFuture;
selectedMeasurements = await markerListFuture; selectedMeasurements = await markerListFuture;
} }
} catch (e) { } catch (e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment