TraversalEdgeBehavior enum

Controls the focus transfer at the edges of a FocusScopeNode. For movement transfers (previous or next), the edge represents the first or last items. For directional transfers, the edge represents the outermost items of the FocusScopeNode, For example: for moving downwards, the edge node is the one with the largest bottom coordinate; for moving leftwards, the edge node is the one with the smallest x coordinate.

This enumeration only controls the traversal behavior performed by FocusTraversalPolicy. Other methods of focus transfer, such as direct calls to FocusNode.requestFocus and FocusNode.unfocus, are not affected by this enumeration.

See also:

Inheritance
Available extensions

Values

closedLoop → const TraversalEdgeBehavior

Keeps the focus among the items of the focus scope.

Transfer focus to the edge node in the opposite direction of FocusScopeNode as the edge node continues to move, thus forming a closed loop of focusable items.

For moving transfers, requesting the next focus after the last focusable item will transfer focus to the first item, and requesting focus before the first item will transfer focus to the last item.

For directional transfers, continuing to request right focus at the rightmost node will transfer focus to the leftmost node. Continuing to request left focus at the leftmost node will transfer focus to the rightmost node.

leaveFlutterView → const TraversalEdgeBehavior

Allows the focus to leave the FlutterView.

Requesting next focus after the last focusable item or previous to the first item will unfocus any focused nodes. If the focus traversal action was initiated by the embedder (e.g. the Flutter Engine) the embedder receives a result indicating that the focus is no longer within the current FlutterView. For example, NextFocusAction invoked via keyboard (typically the TAB key) would receive KeyEventResult.skipRemainingHandlers allowing the embedder handle the shortcut. On the web, typically the control is transferred to the browser, allowing the user to reach the address bar, escape an iframe, or focus on HTML elements other than those managed by Flutter.

parentScope → const TraversalEdgeBehavior

Allows focus to traverse up to parent scope.

When reaching the edge of the current scope, requesting the next focus will look up to the parent scope of the current scope and focus the focus node next to the current scope.

If there is no parent scope above the current scope, fallback to closedLoop behavior.

stop → const TraversalEdgeBehavior

Stops the focus traversal at the edge of the focus scope.

Keeps the focus in its current position when it reaches the edge of a focus scope.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
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
toString() String
A string representation of this object.
inherited

Operators

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

Constants

values → const List<TraversalEdgeBehavior>
A constant List of the values in this enum, in order of their declaration.