of static method

Returns the nearest enclosing GlassNavigationStackState, or throws if none found.

Implementation

static GlassNavigationStackState of(BuildContext context) {
  final state = maybeOf(context);
  assert(state != null, 'No GlassNavigationStack found in context.');
  return state!;
}