INNER CODE UNIT · Dart
onGeofence
transistorsoft/flutter_background_geolocation · lib/models/background_geolocation.dart:1392
static Subscription onGeofence(Function(GeofenceEvent) callback) {
if (_eventsGeofence == null) {
_eventsGeofence = _eventChannelGeofence
.receiveBroadcastStream()
.map((dynamic event) => GeofenceEvent(event));
}
_registerSubscription(_eventsGeofence!.listen(callback), callback);
return Subscription._(() async {
removeListener(callback);
});
}
/// Subscribe to changes in actively monitored geofences.
///
/// Fired when the list of monitored-geofences changed. The BackgroundGeolocation SDK contains powerful geofencing features that allow you to monitor any number of circular geofences you wish (thousands even), in spite of limits imposed by the native platform APIs (**20 for iOS; 100 for Android**).
///
/// The plugin achieves this by storing your geofences in its database, using a [geospatial query](https://en.wikipedia.org/wiki/Spatial_query) to determine those geofences in proximity (@see [GeoConfig.geofenceProximityRadius]), activating only those geofences closest to the device's current location (according to limit imposed by the corresponding platform).
///