parentNode property

FocusNode? parentNode

The optional parent node to use when reparenting the focusNode for this Focus widget.

If parentNode is null, then Focus.maybeOf is used to find the parent in the widget tree, which is typically what is desired, since it is easier to reason about the focus tree if it mirrors the shape of the widget tree.

Set this property if the focus tree needs to have a different shape than the widget tree. This is typically in cases where a dialog is in an Overlay (or another part of the widget tree), and focus should behave as if the widgets in the overlay are descendants of the given parentNode for purposes of focus.

Defaults to null.


final FocusNode? parentNode;