routeToAuth function
dynamic
routeToAuth({
- dynamic data,
- dynamic result,
- bool removeUntilPredicate(
- Route route
- PageTransitionSettings? pageTransitionSettings,
- PageTransitionType? pageTransition,
- dynamic onPop(
- dynamic value
Navigate to the auth route.
Implementation
routeToAuth(
{dynamic data,
NavigationType navigationType = NavigationType.pushAndForgetAll,
dynamic result,
bool Function(Route<dynamic> route)? removeUntilPredicate,
PageTransitionSettings? pageTransitionSettings,
PageTransitionType? pageTransition,
Function(dynamic value)? onPop}) async {
NyArgument nyArgument = NyArgument(data);
String? route = NyNavigator.instance.router.getAuthRouteName();
if (route == null) {
NyLogger.debug("No auth route set");
return;
}
await NyNavigator.instance.router
.navigate(route,
args: nyArgument,
navigationType: navigationType,
result: result,
removeUntilPredicate: removeUntilPredicate,
pageTransitionType: pageTransition,
pageTransitionSettings: pageTransitionSettings)
.then((v) => onPop != null ? onPop(v) : (v) {});
}