mirror of
https://github.com/SyncrowIOT/web.git
synced 2026-10-24 02:27:56 +00:00
fixes unique id for card drag
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
abstract class DeviceFunction<T> {
|
||||
final String deviceId;
|
||||
final String deviceName;
|
||||
@@ -24,7 +22,6 @@ class DeviceFunctionData {
|
||||
final dynamic value;
|
||||
final String? condition;
|
||||
final String? valueDescription;
|
||||
final UniqueKey uniqueKey;
|
||||
|
||||
DeviceFunctionData({
|
||||
required this.entityId,
|
||||
@@ -34,7 +31,7 @@ class DeviceFunctionData {
|
||||
required this.value,
|
||||
this.condition,
|
||||
this.valueDescription,
|
||||
}) : uniqueKey = UniqueKey();
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
|
||||
// import 'package:syncrow_web/pages/device_managment/all_devices/models/devices_model.dart';
|
||||
|
||||
class RoutineItem {
|
||||
final AllDevicesModel device;
|
||||
final String? function;
|
||||
final dynamic value;
|
||||
// class RoutineItem {
|
||||
// final AllDevicesModel device;
|
||||
// final String? function;
|
||||
// final dynamic value;
|
||||
|
||||
RoutineItem({
|
||||
required this.device,
|
||||
this.function,
|
||||
this.value,
|
||||
});
|
||||
// RoutineItem({
|
||||
// required this.device,
|
||||
// this.function,
|
||||
// this.value,
|
||||
// });
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'device': device,
|
||||
'function': function,
|
||||
'value': 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'],
|
||||
);
|
||||
}
|
||||
}
|
||||
// factory RoutineItem.fromMap(Map<String, dynamic> map) {
|
||||
// return RoutineItem(
|
||||
// device: map['device'] as AllDevicesModel,
|
||||
// function: map['function'],
|
||||
// value: map['value'],
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// : uniqueCustomId = uniqueCustomId ?? const Uuid().v4()
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class ScenesModel {
|
||||
final String id;
|
||||
final String name;
|
||||
@@ -7,11 +5,13 @@ class ScenesModel {
|
||||
final String type;
|
||||
final String? icon;
|
||||
|
||||
ScenesModel({required this.id, required this.name, required this.status, required this.type, this.icon});
|
||||
|
||||
factory ScenesModel.fromRawJson(String str) => ScenesModel.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
ScenesModel({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.status,
|
||||
required this.type,
|
||||
this.icon,
|
||||
});
|
||||
|
||||
factory ScenesModel.fromJson(Map<String, dynamic> json) => ScenesModel(
|
||||
id: json["id"],
|
||||
|
||||
Reference in New Issue
Block a user