push<T extends Object?> method

Future<T?> push<T extends Object?>(
  1. BuildContext context,
  2. Route<T> route, [
  3. String? source
])

This method is replacement of Navigator.push(), but fires onResume() after route popped

Implementation

Future<T?> push<T extends Object?>(BuildContext context, Route<T> route,
    [String? source]) {
  _isPaused = true;
  onPause();

  return Navigator.of(context).push<T>(route).then((value) {
    _isPaused = false;

    resume.data = value;
    resume.source = source;

    onResume();
    return value;
  });
}