KeyMessage class Null safety

The assumbled information corresponding to a native key message.

While Flutter's KeyEvents are created from key messages from the native platform, every native message might result in multiple KeyEvents. For example, this might happen in order to synthesize missed modifier key presses or releases. A KeyMessage bundles all information related to a native key message together for the convenience of propagation on the FocusNode tree.

When dispatched to handlers or listeners, or propagated through the FocusNode tree, all handlers or listeners belonging to a node are executed regardless of their KeyEventResult, and all results are combined into the result of the node using combineKeyEventResults.

In very rare cases, a native key message might not result in a KeyMessage. For example, key messages for Fn key are ignored on macOS for the convenience of cross-platform code.

Annotations

Constructors

KeyMessage(List<KeyEvent> events, RawKeyEvent rawEvent)
Create a KeyMessage by providing all information. [...]
const

Properties

events List<KeyEvent>
The list of KeyEvents converted from the native key message. [...]
final
hashCode int
The hash code for this object. [...]
read-only, inherited
rawEvent RawKeyEvent
The native key message in the form of a raw key event. [...]
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
override

Operators

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