pop<E> method

void pop<E>([
  1. E? result
])

Discards the current page and returns to the previous page.

If canPop is false, the application is terminated.

By passing a value to result, an object can be passed to the return value of push or replace.

現在のページを破棄し、前のページに戻ります。

canPopfalseの場合、アプリを終了します。

resultに値を渡すことによりpushreplaceの戻り値にオブジェクトを渡すことができます。

Implementation

void pop<E>([E? result]) {
  if (!canPop()) {
    SystemNavigator.pop();
    return;
  }
  final container = _pageStack.removeLast();
  container.completer.complete(result);
  _routerDelegate.notifyListeners();
}