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