storeNewVenue method

dynamic storeNewVenue(
  1. LatLng _latLng,
  2. String _venue, {
  3. String? displayName,
})

stores a new venue in the local storage

Implementation

storeNewVenue(LatLng _latLng, String _venue, {String? displayName}) async {
  if (alreadyExists(VenueLatLng(
    _venue,
    latitude: _latLng.latitude,
    longitude: _latLng.longitude,
    displayName: displayName,
  ))) {
    return;
  }

  Queue<VenueLatLng> _tempVenues = venues;

  if (venues.length == 10) {
    _tempVenues.removeFirst();
  }

  _tempVenues.add(VenueLatLng(_venue,
      latitude: _latLng.latitude,
      longitude: _latLng.longitude,
      displayName: displayName));
  await _storeVenue(_tempVenues);
}