push fixes

This commit is contained in:
ashrafzarkanisala
2024-08-01 03:11:03 +03:00
parent a242876e16
commit b66fbc32e7
21 changed files with 647 additions and 331 deletions

View File

@ -65,19 +65,31 @@ class SceneDetailsModel {
class Action {
final String actionExecutor;
final String entityId;
final ExecutorProperty executorProperty;
ExecutorProperty? executorProperty;
String? name;
String? type;
Action({
required this.actionExecutor,
required this.entityId,
required this.executorProperty,
this.executorProperty,
this.name,
this.type,
});
String toRawJson() => json.encode(toJson());
static Action? fromJson(Map<String, dynamic> json) {
if (json['name'] != null && json['type'] != null) {
return Action(
actionExecutor: json["actionExecutor"],
entityId: json["entityId"],
name: json['name'],
type: json['type'],
);
}
if (json["executorProperty"] == null) {
return null; // Return null if executorProperty is not present
return null;
}
return Action(
@ -90,7 +102,7 @@ class Action {
Map<String, dynamic> toJson() => {
"actionExecutor": actionExecutor,
"entityId": entityId,
"executorProperty": executorProperty.toJson(),
"executorProperty": executorProperty?.toJson(),
};
}