Update Bottom Navigator in MainScreen
This commit is contained in:
66
lib/feature/device_log/device_logs_model.dart
Normal file
66
lib/feature/device_log/device_logs_model.dart
Normal file
@@ -0,0 +1,66 @@
|
||||
class DeviceLog {
|
||||
String? thingId;
|
||||
DateTime? from;
|
||||
DateTime? to;
|
||||
int? total;
|
||||
int? offset;
|
||||
List<SensorLogs>? sensors;
|
||||
|
||||
DeviceLog({
|
||||
this.thingId,
|
||||
this.from,
|
||||
this.to,
|
||||
this.total,
|
||||
this.offset,
|
||||
this.sensors,
|
||||
});
|
||||
|
||||
DeviceLog.fromJson(Map<String, dynamic> json) {
|
||||
thingId = json["thing_id"];
|
||||
from = DateTime.parse(json["from"]);
|
||||
to = DateTime.parse(json["to"]);
|
||||
total = json["total"];
|
||||
offset = json["offset"];
|
||||
if (json['sensors'] != null) {
|
||||
sensors = [];
|
||||
json['sensors'].forEach((v) {
|
||||
sensors!.add(SensorLogs.fromJson(v));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SensorLogs {
|
||||
String? name;
|
||||
int? value;
|
||||
int? time;
|
||||
LogDetail? detail;
|
||||
|
||||
SensorLogs({
|
||||
this.name,
|
||||
this.value,
|
||||
this.time,
|
||||
this.detail,
|
||||
});
|
||||
SensorLogs.fromJson(Map<String, dynamic> json) {
|
||||
name = json["n"];
|
||||
value = json["v"];
|
||||
time = json["t"];
|
||||
detail = json["x"] != null ? LogDetail.fromJson(json["x"]) : null;
|
||||
}
|
||||
}
|
||||
|
||||
class LogDetail {
|
||||
String? username;
|
||||
String? note;
|
||||
|
||||
LogDetail({
|
||||
this.username,
|
||||
this.note,
|
||||
});
|
||||
|
||||
LogDetail.fromJson(Map<String, dynamic> json) {
|
||||
username = json["username"];
|
||||
note = json["note"];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user