Add locations and save them, remove locations and delete them
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user