// 设备信息模型 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 json) { return DeviceInfo( name: json['name'] ?? '', id: json['id'] ?? '', rssi: json['rssi'] ?? 0, ); } }