首次提交

This commit is contained in:
wyf
2026-04-25 17:45:10 +08:00
commit ebd4096bfc
135 changed files with 6805 additions and 0 deletions

View 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,
);
}
}

24
lib/models/LogType.dart Normal file
View File

@@ -0,0 +1,24 @@
// 日志类型
enum LogType {
info,
success,
error,
warning,
device, // 设备日志
connection, // 连接日志
}
// 日志条目模型
class LogEntry {
final String message;
final DateTime time;
final LogType type;
final String? deviceId; // 可选关联的设备ID
LogEntry({
required this.message,
required this.time,
required this.type,
this.deviceId,
});
}

22
lib/models/UserInfo.dart Normal file
View File

@@ -0,0 +1,22 @@
// 用户信息模型
class UserInfo {
final String uuid;
final String deviceModel;
final String connectedAt;
UserInfo({
required this.uuid,
required this.deviceModel,
required this.connectedAt,
});
factory UserInfo.fromJson(Map<String, dynamic> json) {
return UserInfo(
uuid: json['uuid'] ?? '',
deviceModel: json['deviceModel'] ?? '',
connectedAt: json['connectedAt'] ?? '',
);
}
}