mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-11-27 18:44:55 +00:00
push add ac fucntions and handle doplicate adding to the then or if items
This commit is contained in:
29
lib/pages/routiens/models/routine_item.dart
Normal file
29
lib/pages/routiens/models/routine_item.dart
Normal file
@ -0,0 +1,29 @@
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
|
||||
|
||||
class RoutineItem {
|
||||
final AllDevicesModel device;
|
||||
final String? function;
|
||||
final dynamic value;
|
||||
|
||||
RoutineItem({
|
||||
required this.device,
|
||||
this.function,
|
||||
this.value,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'device': device,
|
||||
'function': function,
|
||||
'value': value,
|
||||
};
|
||||
}
|
||||
|
||||
factory RoutineItem.fromMap(Map<String, dynamic> map) {
|
||||
return RoutineItem(
|
||||
device: map['device'] as AllDevicesModel,
|
||||
function: map['function'],
|
||||
value: map['value'],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user