push<T> method

Future<T?> push<T>(
  1. String location, {
  2. required RouteMatchList base,
  3. Object? extra,
})

Pushes the location as a new route on top of base.

Implementation

Future<T?> push<T>(String location,
    {required RouteMatchList base, Object? extra}) {
  final Completer<T?> completer = Completer<T?>();
  _setValue(
    location,
    RouteInformationState<T>(
      extra: extra,
      baseRouteMatchList: base,
      completer: completer,
      type: NavigatingType.push,
    ),
  );
  return completer.future;
}