NodeFlowActionDispatcher<T> class

A Flutter Action that dispatches to NodeFlow actions based on intent actionId.

This class acts as a dispatcher that bridges Flutter's Actions framework with NodeFlow's action system. It receives NodeFlowActionIntents and dispatches them to the appropriate NodeFlowAction based on the intent's actionId.

The dispatcher:

  • Looks up the appropriate NodeFlowAction using the intent's actionId
  • Checks if the action can be executed before invoking it
  • Executes the action with the controller and optional context

This design allows all NodeFlow actions to be handled by a single Flutter Action, which is compatible with Flutter's type-based action registration system.

Example usage:

final dispatcher = NodeFlowActionDispatcher(controller);
actions[NodeFlowActionIntent] = dispatcher;

See also:

Inheritance

Constructors

NodeFlowActionDispatcher(NodeFlowController<T> controller)
Creates a NodeFlow action dispatcher.

Properties

callingAction Action<NodeFlowActionIntent<T>>?
The Action overridden by this Action.
no setterinherited
controller NodeFlowController<T>
The controller that actions operate on.
final
hashCode int
The hash code for this object.
no setterinherited
intentType Type
Gets the type of intent this action responds to.
no setterinherited
isActionEnabled bool
Whether this Action is inherently enabled.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addActionListener(ActionListenerCallback listener) → void
Register a callback to listen for changes to the state of this action.
inherited
consumesKey(NodeFlowActionIntent<T> intent) bool
Indicates whether this action should treat key events mapped to this action as being "handled" when it is invoked via the key event.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
invoke(NodeFlowActionIntent<T> intent) Object?
Dispatches the intent to the appropriate NodeFlow action.
override
isEnabled(NodeFlowActionIntent<T> intent) bool
Checks if the action specified in the intent can currently be executed.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyActionListeners() → void
Call all the registered listeners.
inherited
removeActionListener(ActionListenerCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toKeyEventResult(NodeFlowActionIntent<T> intent, covariant Object? invokeResult) KeyEventResult
Converts the result of invoke of this action to a KeyEventResult.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited