Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomRoute() transition gets overridden by defaultRouteType #1956

Open
arhamsc opened this issue May 21, 2024 · 0 comments
Open

CustomRoute() transition gets overridden by defaultRouteType #1956

arhamsc opened this issue May 21, 2024 · 0 comments

Comments

@arhamsc
Copy link

arhamsc commented May 21, 2024

I have a DeviceControllerRoute that has been wrapped in CustomRoute to have a custom transition. But it is not being implemented and only the global override of fadeIn transition occurs.

I have an auto route config such as:

@AutoRouterConfig(replaceInRouteName: 'Screen,Route')
class AppRouter extends $AppRouter {
  AppRouterRef ref;

  AppRouter(this.ref);

  @override
  List<AutoRoute> get routes => [
        AutoRoute(
          page: MainTabBarRoute.page,
          path: "/",
          fullMatch: true,
          children: [
            AutoRoute(
              page: HomeRoute.page,
              path: "home",
            ),
            AutoRoute(
              page: MyDevicesRoute.page,
              path: "devices",
            ),
            AutoRoute(
              page: ServicesRoute.page,
              path: "services",
            ),
            AutoRoute(
              page: MyProfileRoute.page,
              path: "profile",
            ),
          ],
        ),
        AutoRoute(
          // Use separate wrappers for each root route.
          page: AuthEmptyRoute.page,
          usesPathAsKey: true,
          // initial: true,
          path: "/auth",
          children: [
            AutoRoute(page: AuthIntroRoute.page, path: ""),
            AutoRoute(page: AuthRoute.page, path: "auth-login-register"),
          ],
        ),
        AutoRoute(
          path: "/devices",
          page: DeviceEmptyRoute.page,
          usesPathAsKey: true,
          children: [
            AutoRoute(
              path: "add",
              page: DeviceEmptyRoute.page,
              usesPathAsKey: true,
              children: [
                AutoRoute(
                  path: "",
                  page: AddDeviceIntro1Route.page,
                ),
                AutoRoute(
                  path: "lookup",
                  page: AddDeviceLookupRoute.page,
                ),
                AutoRoute(
                  path: "connect-wifi",
                  page: AddDeviceConnectWifiRoute.page,
                ),
                AutoRoute(
                  path: "restart",
                  page: AddDeviceRestartDeviceRoute.page,
                ),
                AutoRoute(
                  path: "success",
                  page: AddDeviceSuccessRoute.page,
                ),
                AutoRoute(
                  path: "error",
                  page: AddDeviceErrorRoute.page,
                ),
              ],
            ),
            CustomRoute(
              page: DeviceControllerRoute.page,
              path: ":deviceId/controller",
              transitionsBuilder: TransitionsBuilders.slideTop,
              usesPathAsKey: true,
            ),
          ],
        ),
      ];

  @override
  RouteType get defaultRouteType => const RouteType.custom(
        transitionsBuilder: TransitionsBuilders.fadeIn,
        durationInMilliseconds: 500,
      );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant