Refactor Action class to use type annotations for actionExecutor and entityId

This commit is contained in:
mohammad
2025-04-17 10:41:01 +03:00
parent 5493ca6fb0
commit 73d28a1800

View File

@ -90,8 +90,8 @@ class Action {
static Action? fromJson(Map<String, dynamic> json) { static Action? fromJson(Map<String, dynamic> json) {
if (json['name'] != null && json['type'] != null) { if (json['name'] != null && json['type'] != null) {
return Action( return Action(
actionExecutor: json["actionExecutor"] ?? '', actionExecutor: json["actionExecutor"] as String,
entityId: json["entityId"] ?? '', entityId: json["entityId"] as String,
name: json['name'] as String?, name: json['name'] as String?,
type: json['type'] as String?, type: json['type'] as String?,
productType: json['productType'] as String?, productType: json['productType'] as String?,
@ -102,8 +102,8 @@ class Action {
} }
return Action( return Action(
actionExecutor: json["actionExecutor"] ?? '', actionExecutor: json["actionExecutor"] as String,
entityId: json["entityId"] ?? '', entityId: json["entityId"] as String,
executorProperty: ExecutorProperty.fromJson(json["executorProperty"]), executorProperty: ExecutorProperty.fromJson(json["executorProperty"]),
productType: json['productType'] as String?, productType: json['productType'] as String?,
); );