removePlace method

Future<void> removePlace(
  1. String name,
  2. String country
)

Remove a PlaceModel from the list

Implementation

Future<void> removePlace(String name, String country) async {
  final places = await getPlacesList();
  places.removeWhere(
      (place) => (place.name == name && place.country == country));
  await savePlacesList(places);
}