of static method

Gets the state for the nearest stateful shell route in the Widget tree.

Implementation

static StatefulNavigationShellState of(BuildContext context) {
  final StatefulNavigationShellState? shellState =
      context.findAncestorStateOfType<StatefulNavigationShellState>();
  assert(shellState != null);
  return shellState!;
}