1优化改动设备栏中全部标签栏的设备列表中数据的整合,又数据合并解耦成使用已有组件各自维护,使其样式和逻辑一致。
2接入了无人机机场的实时信息和无人机的实时信息,并创建了对应的组件,并测试。 3.实现了机器人的详情页的视频显示的逻辑为当机器人在线,就在下方同步出来机器人的各个方位视频,并且支持切换。 4.实现了全部设备中对类型的区分和实现了点击进入对应的详情页。 5.修复了部分bug,优化了代码结构,提高了代码的可读性和可维护性。 6更改了机器人列表项中的信息展示为机器序列号和别名和id(优先展示别名) 7.更改了无人机场的信息展示上位 无人机及序列号下位机场序列号。 8优化了无人机机场信息只能是的为明文展示。便于观看理解。
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
class RobotDataModel {
|
||||
final String name;
|
||||
final String id;
|
||||
final String? alias; // 设备别名
|
||||
final String type;
|
||||
final String status;
|
||||
final double battery;
|
||||
@@ -10,6 +11,7 @@ class RobotDataModel {
|
||||
const RobotDataModel({
|
||||
required this.name,
|
||||
required this.id,
|
||||
this.alias,
|
||||
required this.type,
|
||||
required this.status,
|
||||
required this.battery,
|
||||
@@ -18,13 +20,16 @@ class RobotDataModel {
|
||||
|
||||
/// 从 JSON 创建数据模型
|
||||
factory RobotDataModel.fromJson(Map<String, dynamic> json) {
|
||||
final batteryValue = (json['battery'] as num?)?.toDouble() ??
|
||||
(json['capacity_percent'] as num?)?.toDouble() ?? 100.0;
|
||||
|
||||
return RobotDataModel(
|
||||
name: json['deviceName'] ?? json['name'] ?? '',
|
||||
id: json['deviceId']?.toString() ?? json['id']?.toString() ?? '',
|
||||
alias: json['deviceAlias'] as String?, // 获取别名字段
|
||||
type: json['deviceTypeName'] ?? json['type'] ?? '未知类型',
|
||||
status: _getStatusText(json['status'] ?? 0),
|
||||
battery: (json['battery'] as num?)?.toDouble() ??
|
||||
(json['capacity_percent'] as num?)?.toDouble() ?? 0.0,
|
||||
battery: batteryValue,
|
||||
task: json['task'] ?? json['currentTask'] ?? '待机中',
|
||||
);
|
||||
}
|
||||
@@ -34,6 +39,7 @@ class RobotDataModel {
|
||||
return {
|
||||
'name': name,
|
||||
'id': id,
|
||||
'alias': alias,
|
||||
'type': type,
|
||||
'status': status,
|
||||
'battery': battery,
|
||||
|
||||
Reference in New Issue
Block a user