getPlacesList method

Future<List<PlacesModel>> getPlacesList()

Get the list of places

Implementation

Future<List<PlacesModel>> getPlacesList() async {
  List<String>? jsonStringList = _prefs?.getStringList(_keySavedPlaces);
  if (jsonStringList != null) {
    return jsonStringList
        .map((jsonString) => PlacesModel.fromJson(jsonDecode(jsonString)))
        .toList();
  }
  return [];
}