BluetoothDeviceType.fromProto constructor Null safety

BluetoothDeviceType.fromProto(
  1. BluetoothDeviceType type
)

Implementation

factory BluetoothDeviceType.fromProto(proto.BluetoothDeviceType type) {
  BluetoothDeviceType ret;
  switch (type.type) {
    case proto.BluetoothDeviceType_Type.CLASSIC:
      ret = BluetoothDeviceType.classic;
      break;
    case proto.BluetoothDeviceType_Type.DUAL:
      ret = BluetoothDeviceType.dual;
      break;
    case proto.BluetoothDeviceType_Type.LE:
      ret = BluetoothDeviceType.le;
      break;
    default:
      ret = BluetoothDeviceType.unknown;
      break;
  }
  return ret;
}