首次提交
This commit is contained in:
20
lib/models/DeviceInfo.dart
Normal file
20
lib/models/DeviceInfo.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
// 设备信息模型
|
||||
class DeviceInfo {
|
||||
final String name;
|
||||
final String id;
|
||||
final int rssi;
|
||||
|
||||
DeviceInfo({
|
||||
required this.name,
|
||||
required this.id,
|
||||
required this.rssi,
|
||||
});
|
||||
|
||||
factory DeviceInfo.fromJson(Map<String, dynamic> json) {
|
||||
return DeviceInfo(
|
||||
name: json['name'] ?? '',
|
||||
id: json['id'] ?? '',
|
||||
rssi: json['rssi'] ?? 0,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user