of static method

Retrieves the nearest ZenithTenantScope from context.

Asserts that a ZenithScopeProvider ancestor exists.

Implementation

static ZenithTenantScope of(BuildContext context) {
  final provider =
      context.getInheritedWidgetOfExactType<ZenithScopeProvider>();
  assert(
    provider != null,
    'No ZenithScopeProvider found in the widget tree.',
  );
  return provider!.scope;
}