popSheet static method

void popSheet(
  1. BuildContext context
)

Pops the entire enclosing StreamSheetRoute, if one is in the stack.

Useful when the sheet uses nested navigation (see the useNestedNavigation parameter on showStreamSheet) and you want to dismiss the whole sheet at once instead of just the current nested route.

Implementation

static void popSheet(BuildContext context) {
  final scope = _StreamSheetScope.maybeOf(context);
  final route = scope?.route;
  if (route == null) return;
  final navigator = route.navigator;
  if (navigator == null) return;
  if (navigator.canPop()) navigator.pop();
}