pushNamed<T extends Object?> method
Future<T?>
pushNamed<T extends Object?>(
- String path, {
- bool includePrefixMatches = false,
- OnNavigationFailure? onFailure,
Adds corresponding page to given path
to _pages
stack
if includePrefixMatches
is true prefixed-matches
will be added to to target destination
see RouteMatcher.matchUri
if onFailure
callback is provided, navigation errors will be passed to it
otherwise they'll be thrown
Implementation
@optionalTypeArgs
Future<T?> pushNamed<T extends Object?>(
String path, {
bool includePrefixMatches = false,
OnNavigationFailure? onFailure,
}) {
final scope = _findPathScopeOrReportFailure<StackRouter>(
path,
includePrefixMatches: includePrefixMatches,
onFailure: onFailure,
);
if (scope != null) {
return scope.router._pushAllGuarded(
scope.matches,
onFailure: onFailure,
);
}
return SynchronousFuture(null);
}