setAllPlaces static method
- Map<
String, List< dataPlacesModel> >
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));
}