FocusScope class
Manages a group of FocusNodes within a focus scope.
Handles focus traversal (next/previous), activation, and deactivation of all registered nodes.
Constructors
Properties
- currentFocus → FocusNode?
-
The currently focused node, or
nullif no nodes exist.no setter - focusedChild → FocusNode?
-
The FocusNode that currently has focus within this scope.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isActive → bool
-
Whether this scope is currently active.
no setter
-
nodes
→ List<
FocusNode> -
The list of all registered nodes in this scope.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
activate(
) → void - Activates this scope, restoring focus to the last focused child.
-
addNode(
FocusNode node) → void -
Registers
nodewith this scope. -
deactivate(
) → void - Deactivates this scope, removing focus from all nodes.
-
dispose(
) → void - Deactivates the scope and clears all registered nodes.
-
nextFocus(
) → void - Moves focus to the next focusable node in the scope.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
previousFocus(
) → void - Moves focus to the previous focusable node in the scope.
-
removeNode(
FocusNode node) → void -
Removes
nodefrom this scope and transfers focus if needed. -
requestFocus(
FocusNode node) → void -
Requests focus for
node(alias for setFocus). -
restoreFocus(
) → void - Restores focus to the previously focused child or the first focusable node.
-
setFocus(
FocusNode node) → void -
Gives focus to
nodewithin this scope. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited