replaceNamed<T extends Object?> method
Future<T?>
replaceNamed<T extends Object?>(
- String path, {
- bool includePrefixMatches = false,
- OnNavigationFailure? onFailure,
Implementation
@optionalTypeArgs
Future<T?> replaceNamed<T extends Object?>(
String path, {
bool includePrefixMatches = false,
OnNavigationFailure? onFailure,
}) {
final scope = _findPathScopeOrReportFailure<StackRouter>(
path,
includePrefixMatches: includePrefixMatches,
onFailure: onFailure,
);
if (scope != null) {
scope.router._removeLast(notify: false);
markUrlStateForReplace();
return scope.router._pushAllGuarded(
scope.matches,
onFailure: onFailure,
);
}
return SynchronousFuture(null);
}