FocusManager class
A node in the keyboard focus tree.
Represents an interactive leaf or branch in the focus management tree.
Key events bubble up the active node path starting from the primary focused leaf
up to the root focus scope, until one of the nodes consumes it by returning true.
Core API Reference
| Property / Method | Description |
|---|---|
isFocused |
Whether this node has keyboard focus. |
parent |
The ancestor focus node in the tree. |
children |
Direct descendants of this focus node. |
onKeyEvent |
Callback to process a key event. Return true to stop propagation. |
onFocusChange |
Callback executed when focus status transitions. |
| Centralized registry managing active focus paths. |
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- primaryFocus → FocusNode?
-
Returns the currently active focused leaf node in O(1) time.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setPrimaryFocus(
FocusNode? node) → void -
Sets focus to
node, updating the focus path to the root. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → FocusManager
-
The singleton instance of FocusManager.
final