popAndPush<T extends Object?, TO extends Object?> method

Future<T?> popAndPush<T extends Object?, TO extends Object?>(
  1. String routeName, {
  2. TO? result,
  3. Map<String, dynamic> arguments = const {},
  4. List<String> holdBlocNames = const [],
})

Implementation

Future<T?> popAndPush<T extends Object?, TO extends Object?>(
  String routeName, {
  TO? result,
  Map<String, dynamic> arguments = const {},
  List<String> holdBlocNames = const [],
}) {
  Map<String, dynamic> newArguments = Map.from(arguments);
  newArguments['##holdBlocNames##'] = holdBlocNames;
  holdBlocNames.forEach(GlobalStore().pushState);
  return state.popAndPushNamed<T, TO>(
    routeName,
    result: result,
    arguments: newArguments,
  );
}