onGeofence static method
- void callback(), {
- Function? onError,
Subscribes to geofence events.
Implementation
static StreamSubscription<GeofenceEvent> onGeofence(
void Function(GeofenceEvent) callback, {
Function? onError,
}) {
return events
.where((event) => event.type == EventType.geofence)
.map((event) => event.data)
.where((data) => data is GeofenceEvent)
.cast<GeofenceEvent>()
.listen(callback, onError: onError);
}