canPop static method

bool canPop(
  1. BuildContext context
)

Returns whether the navigation stack can be popped.

This is equivalent to calling NavPages.of(context).canPop(). Returns true if there are pages in the stack that can be popped.

Example:

if (NavPages.canPop(context)) {
  NavPages.pop(context);
}

Implementation

static bool canPop(BuildContext context) {
  return of(context).canPop();
}