This commit is contained in:
ashrafzarkanisala
2024-10-08 11:48:35 +03:00
parent c06f3d5a58
commit 66f6b1cba9
25 changed files with 258 additions and 422 deletions
@@ -1,6 +1,6 @@
import 'package:syncrow_web/utils/constants/app_enum.dart';
import 'package:syncrow_web/utils/constants/assets.dart';
import 'package:syncrow_web/utils/enum/device_types.dart';
import 'package:syncrow_web/utils/constants/app_enum.dart';
class DeviceModel {
dynamic productUuid;
@@ -51,7 +51,6 @@ class DeviceModel {
factory DeviceModel.fromJson(Map<String, dynamic> json) {
String tempIcon = '';
DeviceType type = devicesTypesMap[json['productType']] ?? DeviceType.Other;
if (type == DeviceType.LightBulb) {
tempIcon = Assets.lightBulb;
} else if (type == DeviceType.CeilingSensor || type == DeviceType.WallSensor) {
@@ -66,9 +65,16 @@ class DeviceModel {
tempIcon = Assets.gangSwitch;
} else if (type == DeviceType.Gateway) {
tempIcon = Assets.gateway;
} else if (type == DeviceType.OneGang) {
tempIcon = Assets.oneGang;
} else if (type == DeviceType.TwoGang) {
tempIcon = Assets.twoGang;
} else if (type == DeviceType.WH) {
tempIcon = Assets.waterHeater;
} else {
tempIcon = Assets.logo;
tempIcon = Assets.blackLogo;
}
return DeviceModel(
productUuid: json['productUuid'],
productType: json['productType'],