subscribeToConnectivityStateChanges method

  1. @override
UnsubscribeFunction subscribeToConnectivityStateChanges(
  1. 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);
}