Actions class

A widget that maps Intent types to Actions for its descendants.

Place Actions above ShortcutActionsHandler so intents can be resolved to concrete actions when a shortcut is triggered.

Inheritance

Constructors

Actions({Key? key, required Map<Type, Action<Intent>> actions, required Widget child})
Creates an Actions widget with the given actions map.
const

Properties

actions Map<Type, Action<Intent>>
The map of intent types to actions.
final
child Widget
The widget subtree that can invoke these actions.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates the Element for this widget.
inherited
createState() State<Actions>
Creates the mutable state for this widget.
override
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

Static Methods

invoke(BuildContext context, Intent intent) Object?
Invokes the action matching intent's runtime type.
lookup<T extends Intent>(BuildContext context) Action<Intent>?
Looks up the Action for intent type T by traversing ancestors.
lookupByType(Type intentType, BuildContext context) Action<Intent>?
Looks up the Action for intentType by traversing ancestors.
of(BuildContext context) Map<Type, Action<Intent>>?
Retrieves the nearest action map from the widget tree.