mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00

1. Overlapping line not removed. 2. The colors of the data on X axis and Y axis are not identical to design. 3. Day 1 and 2 are missing on the X axis. 4. When the chart loads, we see it coming from the top right corner (check the attached video). 5. Display all available devices even if they have no data and make the chart empty state.
66 lines
1.8 KiB
Dart
66 lines
1.8 KiB
Dart
class AnalyticsDevice {
|
|
const AnalyticsDevice({
|
|
required this.uuid,
|
|
required this.name,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.deviceTuyaUuid,
|
|
required this.isActive,
|
|
required this.productDevice,
|
|
});
|
|
|
|
final String uuid;
|
|
final String name;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final String deviceTuyaUuid;
|
|
final bool isActive;
|
|
final ProductDevice productDevice;
|
|
|
|
factory AnalyticsDevice.fromJson(Map<String, dynamic> json) {
|
|
return AnalyticsDevice(
|
|
uuid: json['uuid'] as String? ?? '',
|
|
name: json['name'] as String? ?? '',
|
|
createdAt: DateTime.parse(json['createdAt'] as String? ?? ''),
|
|
updatedAt: DateTime.parse(json['updatedAt'] as String? ?? ''),
|
|
deviceTuyaUuid: json['deviceTuyaUuid'] as String? ?? '',
|
|
isActive: json['isActive'] as bool? ?? false,
|
|
productDevice: ProductDevice.fromJson(
|
|
json['productDevice'] as Map<String, dynamic>? ?? {},
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class ProductDevice {
|
|
const ProductDevice({
|
|
required this.uuid,
|
|
required this.createdAt,
|
|
required this.updatedAt,
|
|
required this.catName,
|
|
required this.prodId,
|
|
required this.name,
|
|
required this.prodType,
|
|
});
|
|
|
|
final String uuid;
|
|
final DateTime createdAt;
|
|
final DateTime updatedAt;
|
|
final String catName;
|
|
final String prodId;
|
|
final String name;
|
|
final String prodType;
|
|
|
|
factory ProductDevice.fromJson(Map<String, dynamic> json) {
|
|
return ProductDevice(
|
|
uuid: json['uuid'] as String? ?? '',
|
|
createdAt: DateTime.parse(json['createdAt'] as String? ?? ''),
|
|
updatedAt: DateTime.parse(json['updatedAt'] as String? ?? ''),
|
|
catName: json['catName'] as String? ?? '',
|
|
prodId: json['prodId'] as String? ?? '',
|
|
name: json['name'] as String? ?? '',
|
|
prodType: json['prodType'] as String? ?? '',
|
|
);
|
|
}
|
|
}
|