routeToAuth function

dynamic routeToAuth({
  1. dynamic data,
  2. NavigationType navigationType = NavigationType.pushAndForgetAll,
  3. dynamic result,
  4. bool removeUntilPredicate(
    1. Route route
    )?,
  5. PageTransitionSettings? pageTransitionSettings,
  6. PageTransitionType? pageTransition,
  7. dynamic onPop(
    1. 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) {});
}