findFirstFocus method
Returns the node that should receive focus if focus is traversing forwards, and there is no current focus.
The node returned is the node that should receive focus if focus is
traversing forwards (i.e. with next), and there is no current focus in
the nearest FocusScopeNode that currentNode
belongs to.
If ignoreCurrentFocus
is false or not given, this function returns the
FocusScopeNode.focusedChild, if set, on the nearest scope of the
currentNode
, otherwise, returns the first node from sortDescendants,
or the given currentNode
if there are no descendants.
If ignoreCurrentFocus
is true, then the algorithm returns the first node
from sortDescendants, or the given currentNode
if there are no
descendants.
See also:
- next, the function that is called to move the focus to the next node.
- DirectionalFocusTraversalPolicyMixin.findFirstFocusInDirection, a function that finds the first focusable widget in a particular direction.
Implementation
FocusNode? findFirstFocus(FocusNode currentNode, {bool ignoreCurrentFocus = false}) {
return _findInitialFocus(currentNode, ignoreCurrentFocus: ignoreCurrentFocus);
}