onConnectivityChanged property

  1. @override
Stream<ConnectivityResult> get onConnectivityChanged
override

Fires whenever the connectivity state changes.

Implementation

@override
Stream<ConnectivityResult> get onConnectivityChanged {
  _onConnectivityChanged ??= eventChannel
      .receiveBroadcastStream()
      .map((dynamic result) => result.toString())
      .map(parseConnectivityResult);
  return _onConnectivityChanged!;
}