pop method

bool pop([
  1. Object? result
])

Pops the top route off the navigator stack.

Returns true if the route was successfully popped.

Implementation

bool pop([Object? result]) {
  if (_history.length > 1) {
    if (!_history.last.canPop) {
      return false;
    }
    final currentRoute = _history.last;
    setState(() {
      _removeLast(result);
    });
    if (currentRoute.fullScreenRender) {
      WidgetsBinding.instance.scheduleFrameWithClear();
    } else {
      WidgetsBinding.instance.scheduleFrame();
    }
    return true;
  }
  return false;
}