navigateBack<T> method

void navigateBack<T>(
  1. BuildContext context, [
  2. T? result
])

Navigate back

The outgoing page tears itself down from its widget's dispose, and the page underneath resumes through MCPPageWidget.didPopNext — the same single owner as the pause on the way in. This only pops.

Implementation

void navigateBack<T>(BuildContext context, [T? result]) {
  if (_pageStack.isNotEmpty) {
    _pageStack.removeLast();
  }

  Navigator.pop(context, result);
}