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";
// Map variables
String selectedLake = 'Mjøsa'; // NB should be initialised to last selected lake
Uint8List selectedRelation = Uint8List(0); // Initialised in init_state.dart
List<Measurement> selectedMeasurements = [];
List<SubDiv> selectedSubdivisions = [];
......
......@@ -74,8 +74,12 @@ Future<void> initialiseState(bool fetchSearchOptions) async {
initSearchOptions();
}
//selectedRelation = await relationFuture;
selectedRelation = await relationFuture; // NB update once fixed
// Last lake initialised to last persistent variable, or Mjøsa if the variable is not found
final prefs = await SharedPreferences.getInstance();
selectedLake = prefs.getString('lasLake') ?? "Mjøsa";
// Set the selected relation
selectedRelation = await relationFuture;
selectedMeasurements = await markerListFuture;
}
} catch (e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment