BluetoothDevice constructor
const
BluetoothDevice({})
创建设备信息。
参数:
id:设备标识,无默认值。name:设备名称,默认null,可能因权限或广播缺失而为空。address:设备地址,默认null。Android 可能等同 MAC;iOS/macOS 通常不公开地址。type:设备类型,默认null,例如ble、classic或平台原生类型。isConnected:是否已连接,默认false。isBonded:是否已绑定/配对,默认false;主要 Android 有意义。raw:原生完整字段,默认const <String, dynamic>{},用于排查平台差异。
Implementation
const BluetoothDevice({
required this.id,
this.name,
this.address,
this.type,
this.isConnected = false,
this.isBonded = false,
this.raw = const <String, dynamic>{},
});