pushReplacement<T extends Object?, TO extends Object?> method
Future<T?>
pushReplacement<
T extends Object?, TO extends Object?>( - String routeName, {
- TO? result,
- Map<String, dynamic> arguments = const {},
- List<String> holdBlocNames = const [],
})
Implementation
Future<T?> pushReplacement<T extends Object?, TO extends Object?>(
String routeName, {
TO? result,
Map<String, dynamic> arguments = const {},
List<String> holdBlocNames = const [],
}) {
if (_isSameTopRoute(routeName, arguments)) {
return Future.value();
}
Map<String, dynamic> newArguments = Map.from(arguments);
newArguments['##holdBlocNames##'] = holdBlocNames;
holdBlocNames.forEach(GlobalStore().pushState);
return state.pushReplacementNamed<T, TO>(
routeName,
result: result,
arguments: newArguments,
);
}