canPop method

bool canPop()

Returns true if the active Navigator can pop.

Implementation

bool canPop() {
  if (navigatorKey.currentState?.canPop() ?? false) {
    return true;
  }
  RouteMatchBase walker = currentConfiguration.matches.last;
  while (walker is ShellRouteMatch) {
    if (walker.navigatorKey.currentState?.canPop() ?? false) {
      return true;
    }
    walker = walker.matches.last;
  }
  return false;
}