pushAndRemoveUntil<T extends Object?> method
Implementation
Future<T?> pushAndRemoveUntil<T extends Object?>(
String newRouteName,
String routeName, {
Map<String, dynamic> arguments = const {},
List<String> holdBlocNames = const [],
}) {
if (_isSameTopRoute(newRouteName, arguments)) {
return Future.value();
}
Map<String, dynamic> newArguments = Map.from(arguments);
newArguments['##holdBlocNames##'] = holdBlocNames;
holdBlocNames.forEach(GlobalStore().pushState);
return state.pushNamedAndRemoveUntil<T>(
newRouteName,
(route) => route.settings.name == routeName,
arguments: newArguments,
);
}