pop<T extends Object?> method

void pop<T extends Object?>([
  1. T? result
])

Pops the top-most route.

Implementation

void pop<T extends Object?>([T? result]) {
  final Iterable<NavigatorState> states = _findCurrentNavigators().where(
    (NavigatorState element) => element.canPop(),
  );
  if (states.isEmpty) {
    throw GoError('There is nothing to pop');
  }
  states.first.pop(result);
}