Skip to content

Commit ef17290

Browse files
committed
Implement option to enable/disable action.
1 parent dbe24c9 commit ef17290

25 files changed

+44
-2
lines changed

lib/src/api/models/action/action.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,14 @@ abstract class ActionModel with SerializableMixin {
102102
ActionType type;
103103

104104
/// Whether the action is non-blocking.
105-
bool nonBlocking = false;
105+
bool nonBlocking;
106+
107+
/// Whether the action is enabled.
108+
bool enabled;
106109

107110
/// Creates an [ActionModel] with the given data.
108-
ActionModel({required this.type, this.nonBlocking = false});
111+
ActionModel(
112+
{required this.type, this.nonBlocking = false, this.enabled = true});
109113

110114
/// Factory constructor for creating a new [ActionModel] instance from
111115
/// JSON data.

lib/src/api/models/action/api_call_action.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class ApiCallAction extends ActionModel with EquatableMixin, SerializableMixin {
2121
this.apiId,
2222
Map<String, String>? parameters,
2323
super.nonBlocking,
24+
super.enabled,
2425
}) : parameters = parameters ?? {},
2526
super(type: ActionType.callApi);
2627

lib/src/api/models/action/api_call_action.g.dart

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/call_function_action.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class CallFunctionAction extends ActionModel
2424
required this.name,
2525
Map<String, dynamic>? params,
2626
super.nonBlocking,
27+
super.enabled,
2728
}) : params = params ?? {},
2829
super(type: ActionType.callFunction);
2930

lib/src/api/models/action/call_function_action.g.dart

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/link_action.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class LinkAction extends ActionModel with EquatableMixin, SerializableMixin {
2121
LinkAction({
2222
required this.url,
2323
super.nonBlocking,
24+
super.enabled,
2425
}) : super(type: ActionType.link);
2526

2627
@override

lib/src/api/models/action/link_action.g.dart

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/load_from_cloud_storage_action.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class LoadFromCloudStorageAction extends ActionModel
3939
this.documentId = '',
4040
this.variable,
4141
super.nonBlocking,
42+
super.enabled,
4243
}) : super(type: ActionType.loadFromCloudStorage);
4344

4445
/// Duplicates this [LoadFromCloudStorageAction] with given data overrides.

lib/src/api/models/action/load_from_cloud_storage_action.g.dart

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/api/models/action/navigation_action.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class NavigationAction extends ActionModel
5454
required this.destinationId,
5555
Map<String, String>? params,
5656
super.nonBlocking,
57+
super.enabled,
5758
}) : params = {...params ?? {}},
5859
super(type: ActionType.navigation);
5960

0 commit comments

Comments
 (0)