addPlace static method

Future addPlace(
  1. String query,
  2. PlacesModel newPlace
)

Adds a place to the list for a specific query.

Implementation

static Future addPlace(String query, PlacesModel newPlace) async {
  List<PlacesModel> places = await getPlaces(query);
  places.add(newPlace);
  await setPlaces(query, places);
}