getBluetoothStateFromString function

BluetoothState getBluetoothStateFromString(
  1. String? state
)

Retrieves the Bluetooth state from the native value

Implementation

BluetoothState getBluetoothStateFromString(String? state) {
  switch (state) {
    case "on":
      return BluetoothState.on;
    case "off":
      return BluetoothState.off;
    case "resetting":
      return BluetoothState.resetting;
    case "unauthorized":
      return BluetoothState.unauthorized;
    case "unsupported":
      return BluetoothState.unsupported;
    default:
      return BluetoothState.unknown;
  }
}