isPlaceExist method

Future<bool> isPlaceExist(
  1. String name,
  2. String country
)

Check if a place is in the list

Implementation

Future<bool> isPlaceExist(String name, String country) async {
  final places = await getPlacesList();
  return places
      .any((place) => (place.name == name && place.country == country));
}