FocusScopeNode class

A specialized focus scope node that manages focus traversal.

Inheritance

Constructors

FocusScopeNode({required String id})
Creates a FocusScopeNode with the given id.

Properties

children List<FocusNode>
The children focus nodes nested under this node.
finalinherited
focusedChild FocusNode?
The active focused child node inside this scope.
no setter
hasFocus bool
Whether this node currently has focus.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasPrimaryFocus bool
Whether this node has primary focus, meaning it is focused and none of its children are.
no setterinherited
id String
Unique identifier of the focus node (useful for debugging).
finalinherited
isFocused bool
Whether this node currently holds focus.
no setterinherited
onFocusChange ↔ void Function(bool hasFocus)?
Callback executed when this focus node gains or loses focus.
getter/setter pairinherited
onKeyEvent bool Function(KeyEvent event)?
Callback executed when a key event hits this node. Return true to consume the keypress and prevent it from bubbling.
getter/setter pairinherited
parent FocusNode?
The parent focus node, if any.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addChild(FocusNode child) → void
Adds a child focus node to this branch.
inherited
bubbleKeyEvent(KeyEvent event) bool
Bubbles the event up the parent chain starting from the focused leaf.
inherited
dispose() → void
Disposes of the focus node, detaching it from the tree.
inherited
findFocusedLeaf() FocusNode?
Traverses down the focused path to find the deeply focused leaf node.
inherited
nextFocus() → void
Cycles keyboard focus forward to the next sibling in the scope's focus list.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
previousFocus() → void
Cycles keyboard focus backward to the previous sibling in the focus list.
removeChild(FocusNode child) → void
Removes a child focus node from this branch.
inherited
requestFocus() → void
Request focus for this specific node.
override
toString() String
A string representation of this object.
inherited
unfocus() → void
Removes focus from this node.
inherited

Operators

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