Add locations and save them, remove locations and delete them

This commit is contained in:
Konstantin Kollar
2022-09-05 11:59:52 +02:00
parent 730634bdb2
commit e96a33f0a3
6 changed files with 75 additions and 48 deletions
+16
View File
@@ -19,4 +19,20 @@ class UserPreferences {
preferences!.setDouble("$name-lon", lon);
return getSavedLocations();
}
static List<String> deleteLocation(String name) {
preferences!.remove("$name-lat");
preferences!.remove("$name-lon");
_savedLocations.remove(name);
preferences!.remove(name);
return getSavedLocations();
}
static getLat(String name) {
return preferences!.getDouble("$name-lat");
}
static getLon(String name) {
return preferences!.getDouble("$name-lon");
}
}