Locations persist. Leaflet and Rest queries

This commit is contained in:
vjrj 2018-06-10 16:20:18 +02:00
parent 7fbe5b971d
commit b5b8b3da51
13 changed files with 196 additions and 192 deletions

View file

@ -5,6 +5,10 @@ final String locationKey = 'yourlocations';
void loadYourLocations(prefs) {
List<String> yourLocations = prefs.getStringList(locationKey);
if (yourLocations == null) {
yourLocations = [];
persistYourLocations(prefs);
}
yourLocations.forEach((locationString) {
Map locationMap = json.decode(locationString);
globals.yourLocations.add(BasicLocation.fromJson(locationMap));