of static method

FocusNode? of(
  1. BuildContext context
)

Finds the nearest ancestor FocusNode in the widget tree.

Implementation

static FocusNode? of(BuildContext context) {
  final scope = context.dependOnInheritedWidgetOfExactType<FocusMarker>();
  return scope?.focusNode;
}