subscribeToConnectivityStateChanges method
UnsubscribeFunction
subscribeToConnectivityStateChanges(
- ConnectivityStateChangeCallback callback
override
Implementation
@override
UnsubscribeFunction subscribeToConnectivityStateChanges(
ConnectivityStateChangeCallback callback,
) {
void wrappedCallback(ConnectivityStateChangeNotification notification) {
if (_hasDbName(notification.dbName)) {
callback(notification);
}
return;
}
final eventListener =
EventListener(EventNames.connectivityStateChange, wrappedCallback);
_subscribe(eventListener);
return () => _unsubscribe(eventListener);
}