mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
push fixes
This commit is contained in:
@ -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(),
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user