FocusTraversalGroupModifier class
A widget that describes the inherited focus policy for focus traversal for its descendants, grouping them into a separate traversal group.
A traversal group is treated as one entity when sorted by the traversal algorithm, so it can be used to segregate different parts of the widget tree that need to be sorted using different algorithms and/or sort orders when using an OrderedTraversalPolicy.
Within the group, it will use the given policy to order the elements. The group itself will be ordered using the parent group's policy.
By default, traverses in reading order using ReadingOrderTraversalPolicy.
To prevent the members of the group from being focused, set the descendantsAreFocusable attribute to false.
{@tool dartpad} This sample shows three rows of buttons, each grouped by a FocusTraversalGroup, each with different traversal order policies. Use tab traversal to see the order they are traversed in. The first row follows a numerical order, the second follows a lexical order (ordered to traverse right to left), and the third ignores the numerical order assigned to it and traverses in widget order.
** See code in examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart ** {@end-tool}
See also:
- FocusNode, for a description of the focus system.
- WidgetOrderTraversalPolicy, a policy that relies on the widget creation order to describe the order of traversal.
- ReadingOrderTraversalPolicy, a policy that describes the order as the natural "reading order" for the current Directionality.
- DirectionalFocusTraversalPolicyMixin a mixin class that implements focus traversal in a direction.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SingleChildStatelessModifier
- FocusTraversalGroupModifier
- Available extensions
Constructors
- FocusTraversalGroupModifier({Key? key, Widget? child, Key? modifierKey, FocusTraversalPolicy? policy, bool descendantsAreFocusable = true, bool descendantsAreTraversable = true})
- Creates a FocusTraversalGroup object.
Properties
- descendantsAreFocusable → bool
-
If false, will make this widget's descendants unfocusable.
final
- descendantsAreTraversable → bool
-
If false, will make this widget's descendants untraversable.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- modifierKey → Key?
-
The actual key of the widget, which Modifier wrapped
finalinherited
- policy → FocusTraversalPolicy
-
The policy used to move the focus from one focus node to another when
traversing them using a keyboard.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
inherited
-
buildWithChild(
BuildContext context, Widget? child) → Widget -
A build method that receives an extra
child
parameter.override -
createElement(
) → SingleChildStatelessElement -
Create a SingleChildStatelessElement
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
modified(
) → Modifier -
Available on Widget, provided by the ModifierTransformer extension
Transform normal widget to Modifier -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited