CallbackAction<T extends Intent> class

An Action that takes a callback in order to configure it without having to create an explicit Action subclass just to call a callback.

See also:

  • Shortcuts, which is a widget that contains a key map, in which it looks up key combinations in order to invoke actions.
  • Actions, which is a widget that defines a map of Intent to Action and allows redefining of actions for its descendants.
  • ActionDispatcher, a class that takes an Action and invokes it using a FocusNode for context.
Inheritance

Constructors

CallbackAction({@required OnInvokeCallback<T> onInvoke})
A constructor for a CallbackAction. [...]

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
intentType Type
Gets the type of intent this action responds to.
read-only, inherited
onInvoke OnInvokeCallback<T>
The callback to be called when invoked. [...]
@protected, final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

addActionListener(ActionListenerCallback listener) → void
Register a callback to listen for changes to the state of this action. [...]
@mustCallSuper, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
@mustCallSuper, @protected, inherited
invoke(covariant T intent) Object
Called when the action is to be performed. [...]
override
isEnabled(covariant T intent) bool
Returns true if the action is enabled and is ready to be invoked. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
notifyActionListeners() → void
Call all the registered listeners. [...]
@protected, @visibleForTesting, inherited
removeActionListener(ActionListenerCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes. [...]
@mustCallSuper, 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
toString({DiagnosticLevel minLevel: DiagnosticLevel.info}) String
Returns 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