pop<T> method

bool pop<T>([
  1. T? result
])

Implementation

bool pop<T>([T? result]) {
  if (!_canPop()) {
    return false;
  }

  final page = _stack.removeLast()..didPop(result);

  final nestedNav = isNestedRoute(page.routeInfo)?.key;

  final remPages = nestedStack[nestedNav];

  if (remPages?.isEmpty ?? false) {
    _stack.removeLast().didPop();
  }

  notifyListeners();

  return true;
}