Implemented room device interface

(AC only)
This commit is contained in:
Mohammad Salameh
2024-03-07 14:53:13 +03:00
parent bf275d5adf
commit f8e8591d13
12 changed files with 357 additions and 244 deletions

View File

@ -1,10 +1,15 @@
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
abstract class DeviceModel {
final String? id;
final String? name;
final String? type;
final DeviceType? type;
bool? status;
final String? image;
final double? timer;
late final String icon;
bool isSelected = false;
DeviceModel({
@ -14,5 +19,25 @@ abstract class DeviceModel {
required this.status,
required this.image,
required this.timer,
});
}) {
switch (type) {
case DeviceType.AC:
icon = Assets.iconsAC;
break;
case DeviceType.Lights:
icon = Assets.iconsLight;
break;
case DeviceType.Door:
icon = Assets.iconsDoorLock;
break;
case DeviceType.Curtain:
icon = Assets.iconsCurtain;
break;
case DeviceType.Gateway:
icon = Assets.iconsGateway;
break;
default:
icon = '';
}
}
}