setAllPlaces static method

Future setAllPlaces(
  1. Map<String, List<PlacesModel>> data
)

Sets the entire map of places.

Implementation

static Future setAllPlaces(Map<String, List<PlacesModel>> data) async {
  final encodedData = data.map((key, places) => MapEntry(
      key, jsonEncode(places.map((place) => place.toJson()).toList())));
  await _prefs?.setString(_keyMap, jsonEncode(encodedData));
}