KeyBindingEvent class
Passed to every KeyBinding.onTrigger handler. Exposes what matched (match), the raw event(s), and per-dispatch propagation control (bubble).
Consume (default): ignore the event; it is claimed.
KeyBinding(.ctrl.s, onTrigger: (_) => save())
Conditionally propagate: call bubble to let the event continue to ancestor bindings, KeyDetectors, or globals instead of being consumed:
KeyBinding(.tab, onTrigger: (event) {
if (!FocusManager.of(context).focusNext()) event.bubble();
})
bubble is only honoured during synchronous handler execution — a call
after an await has no effect, since the propagation decision is already
made.
Constructors
- KeyBindingEvent(KeySequenceMatch match)
- Framework-only. The dispatcher builds one per fired binding; exposed so tests can invoke a handler without standing up a dispatcher.
Properties
- code → KeyCode
-
no setter
- hasAlt → bool
-
no setter
- hasCtrl → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasShift → bool
-
no setter
- isBubbling → bool
-
Whether bubble has been called for this dispatch.
no setter
- match → KeySequenceMatch
-
What matched — the alias that fired and the events it consumed.
final
-
modifiers
→ Set<
KeyModifier> -
no setter
- raw → KeyEvent
-
The final raw KeyEvent of the match (the last step). Sugar for
match.events.last.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → KeyEventType
-
no setter
Methods
-
bubble(
) → void - Let this event continue propagating instead of being consumed (the default). Must be called synchronously; see the class doc.
-
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