pop<T extends Object?> method

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

Pop the current route with animation

result is the optional result to return to the previous route

See Navigator.pop for more details

Implementation

void pop<T extends Object?>([T? result]) {
  try {
    final context = _currentContext;
    if (context == null) {
      if (_enableLogger) {
        debugPrint('NavService.pop: No valid context found.');
      }
      return;
    }
    if (_steps.isNotEmpty) {
      Navigator.of(context).pop<T>(result);
    }
    // ignore: avoid_catches_without_on_clauses
  } catch (e, st) {
    if (_enableLogger) {
      debugPrint('NavService.pop.exception: $e\n$st');
    }
  }
}