push<T> method

Future<T?> push<T>(
  1. String location, {
  2. Object? arguments,
})

Pushes a URL-addressable page. T must match the definition's result type.

Implementation

Future<T?> push<T>(String location, {Object? arguments}) {
  argumentsCodec.encode(arguments);
  parseRouteUri(location);
  final entry = _entry(location, arguments: arguments);
  _change(NavigationAction.push, () => _entries.add(entry));
  return entry.result.future.then((value) => value as T?);
}