bluetoothStateChanged method

Stream<BluetoothState> bluetoothStateChanged()

Start checking for bluetooth state changed.

This will fires BluetoothState whenever bluetooth state changed.

Implementation

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