push<T extends Object?> method
Push a URI location onto the page stack w/ optional query parameters, e.g.
/family/f2/person/p1?color=blue.
See also:
- pushReplacement which replaces the top-most page of the page stack and always use a new page key.
- replace which replaces the top-most page of the page stack but treats it as the same page. The page key will be reused. This will preserve the state and not run any page animation.
Implementation
@override
Future<T?> push<T extends Object?>(String location, {Object? extra}) {
calls.add(NavigationCall(NavigationKind.push, location, extra: extra));
if (_results.containsKey(location)) {
return Future.value(_results[location] as T?);
}
final entry = _Entry(location);
_stack.add(entry);
return entry.result.then((value) => value as T?);
}