FocusNode class abstract
A focus node that stores properties and optionally delegates input/lifecycle to callbacks.
Constructors
Properties
- canFocus ↔ bool
-
Whether this node can receive focus at all.
getter/setter pair
- canTouch ↔ bool
-
Whether this node can receive focus via pointer/touch click.
getter/setter pair
- canTraverse ↔ bool
-
Whether this node is included in tab traversal.
getter/setter pair
- edgeBehavior ↔ EdgeBehavior
-
The edge behavior for this node when it acts as a scope.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCollapsed ← bool
-
Whether this node is collapsed and does not participate in focus.
no getter
- name ↔ String
-
Debug name for this node (does not need to be unique).
getter/setter pair
- onCaptureKeyInput ← KeyInputCallback?
-
Takes part in the capture phase of key events, which runs root first
along the path to the primary focus before the key bubbles back out.
Returning true from
callbackclaims the key: nothing deeper sees its capture phase and nothing bubbles. Null leaves the phase again. A node made without callbacks, or owned by a native FocusData, can't take part.no getter - onCaptureTextInput ← TextInputCallback?
-
Takes part in the capture phase of text input, the same way
onCaptureKeyInput does for keys. Returning true from
callbackclaims the text, so a text input deeper on the path never inserts it. Null leaves the phase again.no getter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tabIndex ↔ int
-
The tab index for traversal ordering.
getter/setter pair
Methods
-
clearWorldBounds(
) → void - Clear the world bounds for this node (marks bounds as unavailable). Nodes without bounds will not participate in directional navigation.
-
clearWorldPosition(
) → void - Clear the position set by setWorldPosition.
-
dispose(
) → void - Dispose of this focus node and release native resources.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setWorldBounds(
double minX, double minY, double maxX, double maxY) → void - Set the world bounds for this node (for directional navigation). Bounds are in root artboard space and used for spatial navigation calculations. Call this during your update cycle when the node's position/size changes.
-
setWorldPosition(
double x, double y) → void - Set this node's world position, in root artboard space, for an owner that has no bounds to report. Directional navigation scores it as a point, as the runtime does a FocusData whose parent is not a layout. Edit time only: the runtimes ship without it, and there it does nothing.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
make(
{KeyInputCallback? onKeyInput, TextInputCallback? onTextInput, FocusCallback? onFocused, FocusCallback? onBlurred}) → FocusNode - Create a FocusNode with optional input/lifecycle callbacks.