maybeOf static method

FocusOrder? maybeOf(
  1. BuildContext context

Finds the FocusOrder in the nearest ancestor FocusTraversalOrder widget.

It does not create a rebuild dependency because changing the traversal order doesn't change the widget tree, so nothing needs to be rebuilt as a result of an order change.

If no FocusTraversalOrder ancestor exists, or the order is null, returns null.


static FocusOrder? maybeOf(BuildContext context) {
  final FocusTraversalOrder? marker = context.getInheritedWidgetOfExactType<FocusTraversalOrder>();
  return marker?.order;