feat: app 端 ui 设计完成
This commit is contained in:
33
wei_ai_app/lib/models/device_status.dart
Normal file
33
wei_ai_app/lib/models/device_status.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
enum DeviceMode { idle, pattern, manual }
|
||||
|
||||
class DeviceStatus {
|
||||
final bool connected;
|
||||
final double battery;
|
||||
final double temperature;
|
||||
final int signalStrength;
|
||||
final DeviceMode currentMode;
|
||||
|
||||
const DeviceStatus({
|
||||
this.connected = false,
|
||||
this.battery = 100.0,
|
||||
this.temperature = 36.5,
|
||||
this.signalStrength = 0,
|
||||
this.currentMode = DeviceMode.idle,
|
||||
});
|
||||
|
||||
DeviceStatus copyWith({
|
||||
bool? connected,
|
||||
double? battery,
|
||||
double? temperature,
|
||||
int? signalStrength,
|
||||
DeviceMode? currentMode,
|
||||
}) {
|
||||
return DeviceStatus(
|
||||
connected: connected ?? this.connected,
|
||||
battery: battery ?? this.battery,
|
||||
temperature: temperature ?? this.temperature,
|
||||
signalStrength: signalStrength ?? this.signalStrength,
|
||||
currentMode: currentMode ?? this.currentMode,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user