maybeOf static method

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

Returns null if no stateful shell route is found.

Implementation

static StatefulNavigationShellState? maybeOf(BuildContext context) {
  final StatefulNavigationShellState? shellState =
      context.findAncestorStateOfType<StatefulNavigationShellState>();
  return shellState;
}