removePlace static method
- String query,
- PlacesModel placeToRemove
Removes a place from the list for a specific query.
Implementation
static Future removePlace(String query, PlacesModel placeToRemove) async {
List<PlacesModel> places = await getPlaces(query);
places.removeWhere((place) =>
place.id == placeToRemove.id &&
place.name == placeToRemove.name &&
place.description == placeToRemove.description);
await setPlaces(query, places);
}