mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00
47 lines
1.1 KiB
Dart
47 lines
1.1 KiB
Dart
import 'package:syncrow_app/features/devices/model/function_model.dart';
|
|
import 'package:syncrow_app/generated/assets.dart';
|
|
import 'package:syncrow_app/utils/resource_manager/constants.dart';
|
|
|
|
class DeviceModel {
|
|
final int? id;
|
|
final String? name;
|
|
final DeviceType? type;
|
|
bool? status;
|
|
final String? image;
|
|
final double? timer;
|
|
late final String icon;
|
|
bool isSelected = false;
|
|
|
|
late List<FunctionModel> functions;
|
|
|
|
DeviceModel({
|
|
required this.id,
|
|
required this.name,
|
|
required this.type,
|
|
required this.status,
|
|
required this.image,
|
|
required this.timer,
|
|
required this.functions,
|
|
}) {
|
|
switch (type) {
|
|
case DeviceType.AC:
|
|
icon = Assets.iconsAC;
|
|
break;
|
|
case DeviceType.Lights:
|
|
icon = Assets.iconsLight;
|
|
break;
|
|
case DeviceType.DoorLock:
|
|
icon = Assets.iconsDoorLock;
|
|
break;
|
|
case DeviceType.Curtain:
|
|
icon = Assets.iconsCurtain;
|
|
break;
|
|
case DeviceType.Gateway:
|
|
icon = Assets.iconsGateway;
|
|
break;
|
|
default:
|
|
icon = '';
|
|
}
|
|
}
|
|
}
|