bluetoothStateChanged method

  1. @override
Stream<BluetoothState> bluetoothStateChanged()
override

Start checking for bluetooth state changed.

This will fires BluetoothState whenever bluetooth state changed.

Implementation

@override
Stream<BluetoothState> bluetoothStateChanged() {
  if (_onBluetoothState == null) {
    _onBluetoothState = _bluetoothStateChangedChannel.receiveBroadcastStream().map((dynamic event) => BluetoothState.parse(event));
  }
  return _onBluetoothState!;
}