ActionConfiguration class abstract
Base class for all action configurations.
Action configurations define the behavior of an action. Each type of configuration implements this class and provides its own execution logic.
Common configuration types include:
- Navigation (push, pop, replace)
- State management (update, reset)
- UI feedback (toast, dialog)
- Data operations (save, delete)
Example implementation:
@JsonSerializable()
class ShowToastConfig extends ActionConfiguration {
static const schemaName = 'action.toast';
final String message;
ShowToastConfig({
required this.message,
super.title,
super.isAwaited,
}) : super(schemaType: schemaName);
@override
Future<void> execute(BuildContext context, {
Map<String, dynamic>? arguments,
}) async {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(message)),
);
}
}
Constructors
- ActionConfiguration.new({required String schemaType, String? title, bool? isAwaited})
- Creates a new action configuration.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAwaited → bool?
-
Whether to await this configuration's execution.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schemaType → String
-
The schema type of this configuration.
final
- title → String?
-
Optional title for this configuration.
final
Methods
-
execute(
BuildContext context, {Map< String, dynamic> ? arguments}) → FutureOr<void> - Executes this configuration.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited