FocusCapabilityDelegate mixin
A mixin that provides an interface for managing focus nodes within the Duit kernel driver API.
Classes that use FocusCapabilityDelegate must implement focus management
behaviors by overriding the methods. By default, methods throw
MissingCapabilityMethodImplementation if not overridden.
See also:
- UnfocusDisposition, for handling how focus should be removed.
- TraversalDirection, for spatial focus navigation.
- Focus cookbook - https://docs.flutter.dev/cookbook/forms/focus
- FocusNode docs - https://api.flutter.dev/flutter/widgets/FocusNode-class.html
- Mixin applications
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
attachFocusNode(
String nodeId, FocusNode node) → void -
Attaches a FocusNode to the delegate, associating it with the provided
nodeId. -
detachFocusNode(
String nodeId) → void -
focusInDirection(
String nodeId, TraversalDirection direction) → bool -
Moves the focus from the node identified by
nodeIdin the specifieddirection. -
getNode(
Object? key) → FocusNode? -
Returns the FocusNode associated with the provided
key, ornullif no such node is attached. -
linkDriver(
UIDriver driver) → void - Links a UIDriver instance to this holder.
-
nextFocus(
String nodeId) → bool -
Moves the focus to the next focusable node in the traversal order relative to the node
identified by
nodeId. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
previousFocus(
String nodeId) → bool -
Moves the focus to the previous focusable node in the traversal order relative to the node
identified by
nodeId. -
releaseResources(
) → void - Called to clean up any external resources, subscriptions, or handlers typically when a delegate is being disposed of or detached. Implementations should ensure all open streams or event sources are closed.
-
requestFocus(
String nodeId) → void -
Requests that the focus be moved to the FocusNode associated with the given
nodeId. -
toString(
) → String -
A string representation of this object.
inherited
-
unfocus(
String nodeId, {UnfocusDisposition disposition = UnfocusDisposition.scope}) → void -
Removes focus from the node identified by
nodeIdand optionally determines the disposition for how focus should be handled within the focus scope.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited