onPeripheralStateChanged property

Stream<PeripheralState>? onPeripheralStateChanged

Returns Stream of state.

After listening to this Stream, you'll be notified about changes in peripheral state.

Implementation

Stream<PeripheralState>? get onPeripheralStateChanged {
  if (Platform.isWindows) return null;
  _peripheralState ??= _stateChangedEventChannel
      .receiveBroadcastStream()
      .map((dynamic event) => PeripheralState.values[event as int]);
  return _peripheralState!;
}