of static method

Returns the MacosWindowScope of the MacosWindow that most tightly encloses the given context.

If the context does not have a MacosWindow as its ancestor, an assertion is thrown.

The context argument must not be null.

Implementation

static MacosWindowScope of(BuildContext context) {
  final MacosWindowScope? result =
      context.dependOnInheritedWidgetOfExactType<MacosWindowScope>();
  assert(result != null, 'No MacosWindowScope found in context');
  return result!;
}