INNER CODE UNIT · Dart
onHttp
transistorsoft/flutter_background_geolocation · lib/models/background_geolocation.dart:1505
static Subscription onHttp(Function(HttpEvent) callback) {
if (_eventsHttp == null) {
_eventsHttp = _eventChannelHttp
.receiveBroadcastStream()
.map((dynamic event) => HttpEvent(event));
}
_registerSubscription(_eventsHttp!.listen(callback), callback);
return Subscription._(() async {
removeListener(callback);
});
}
/// Subscribe to [AppConfig.schedule] events.
///
/// Your `callback` will be executed each time a [AppConfig.schedule] event fires. Your `callback` will be provided with the current [State]: **`state.enabled`** will reflect the state according to your [AppConfig.schedule].
///
/// ## Example
///