savePlacesList method

Future<void> savePlacesList(
  1. List<PlacesModel> places
)

Saving a list of places

Implementation

Future<void> savePlacesList(List<PlacesModel> places) async {
  List<String> jsonStringList =
      places.map((place) => jsonEncode(place.toJson())).toList();
  await _prefs?.setStringList(_keySavedPlaces, jsonStringList);
}