of method

FocusScopeNode of (BuildContext context)

Returns the node of the FocusScope that most tightly encloses the given BuildContext.

The context argument must not be null.

Implementation

static FocusScopeNode of(BuildContext context) {
  assert(context != null);
  final _FocusScopeMarker scope = context.inheritFromWidgetOfExactType(_FocusScopeMarker);
  return scope?.node ?? context.owner.focusManager.rootScope;
}