of method

FocusScopeNode of (BuildContext context)

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

Implementation

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