popAndPushNamed<T extends Object?, TO extends Object?> method
Future<T?>
popAndPushNamed<T extends Object?, TO extends Object?>(
- String routeName, {
- TO? result,
- Object? arguments,
- String? type,
- BuildContext? context,
Implementation
Future<T?> popAndPushNamed<T extends Object?, TO extends Object?>(
String routeName,
{TO? result,
Object? arguments,
String? type,
BuildContext? context}) {
if (!shouldTryOpenRoute(routeName,
context: context, type: type, arguments: arguments)) {
return Future.value(null);
}
eventController.logNavigationEvent(routeName,
arguments: arguments,
type: type ?? MicroAppNavigationType.popAndPushNamed.name);
if (context != null) {
return Navigator.of(context)
.popAndPushNamed(routeName, arguments: arguments, result: result);
} else {
return _nav.popAndPushNamed(routeName,
arguments: arguments, result: result);
}
}