of static method

The nearest scope; throws if missing.

Implementation

static M3ESelectionScope of(BuildContext context) {
  final scope = maybeOf(context);
  assert(
    scope != null,
    'M3ESelectionScope.of() called with no M3ESelectionScope ancestor.',
  );
  return scope!;
}