addLocationListener method

void addLocationListener(
  1. LocationListener listener
)
inherited

Adds a LocationListener to the engine to get notified when there is a new location update available. Supports more than one listener, instance is added only once.

Implementation

void addLocationListener(LocationListener listener) {
  if (!_locationUpdateListeners.containsKey(listener)) {
    _locationUpdateListeners[listener] = LocationUpdateListenerBridge(
      listener,
    );
  }
  _location.addLocationListener(_locationUpdateListeners[listener]!);
}