routeToAuthenticatedRoute function

dynamic routeToAuthenticatedRoute({
  1. dynamic data,
  2. NavigationType navigationType = NavigationType.pushAndForgetAll,
  3. dynamic result,
  4. bool removeUntilPredicate(
    1. Route route
    )?,
  5. PageTransitionSettings? pageTransitionSettings,
  6. PageTransitionType? pageTransitionType,
  7. dynamic onPop(
    1. dynamic value
    )?,
})

Navigate to the auth route.

Implementation

routeToAuthenticatedRoute(
    {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.getAuthRouteName();
  if (route == null) {
    NyLogger.debug("No authenticated route set");
    return;
  }
  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) {});
}