Shortcuts class

A widget that maps ShortcutActivators to Intents for its descendants.

Place Shortcuts above the widgets that should respond to key bindings. Use ShortcutActionsHandler to connect shortcuts to actions.

Inheritance

Constructors

Shortcuts({Key? key, required Map<ShortcutActivator, Intent> shortcuts, required Widget child})
Creates a Shortcuts widget with the given shortcuts map.
const

Properties

child Widget
The widget subtree that can trigger these shortcuts.
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
shortcuts Map<ShortcutActivator, Intent>
The map of keyboard shortcuts to intents.
final

Methods

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

lookup(KeyEvent event, BuildContext context) Intent?
Looks up the Intent for event by traversing ancestors.
of(BuildContext context) Map<ShortcutActivator, Intent>?
Retrieves the nearest shortcut map from the widget tree.