routeToInitial function
dynamic
routeToInitial({
- dynamic data,
- dynamic result,
- bool removeUntilPredicate(
- Route route
- PageTransitionSettings? pageTransitionSettings,
- PageTransitionType? pageTransitionType,
- dynamic onPop(
- dynamic value
Navigate to the initial route.
Implementation
routeToInitial(
{dynamic data,
NavigationType navigationType = NavigationType.pushAndForgetAll,
dynamic result,
bool Function(Route<dynamic> route)? removeUntilPredicate,
PageTransitionSettings? pageTransitionSettings,
PageTransitionType? pageTransitionType,
Function(dynamic value)? onPop}) async {
NyArgument nyArgument = NyArgument(data);
String route = NyNavigator.instance.router.getInitialRouteName();
await NyNavigator.instance.router
.navigate(route,
args: nyArgument,
navigationType: navigationType,
result: result,
removeUntilPredicate: removeUntilPredicate,
pageTransitionType: pageTransitionType,
pageTransitionSettings: pageTransitionSettings)
.then((v) => onPop != null ? onPop(v) : (v) {});
}