Routing strategy management with focus on GoRouter, but supporting AutoRoute, Navigator 2.0, and GetX choices.
Before changing navigation setup, you MUST:
Type-safe deep linking and routing system using go_router and go_router_builder.
core/router/
├── app_router.dart # Router configuration
└── routes.dart # Typed route definitions (GoRouteData)
GoRouteData from go_router_builder. Never use raw path strings.GoRouter instance registered in DI.TypedGoRoute and children lists.redirect property of the GoRouter config.@TypedGoRoute to define paths with :id parameters.buildPage.MyRoute().go(context) or MyRoute().push(context).// Route Definition
@TypedGoRoute<HomeRoute>(path: '/')
class HomeRoute extends GoRouteData {
@override
Widget build(context, state) => const HomePage();
}
// Router Config
final router = GoRouter(
routes: $appRoutes,
redirect: (context, state) {
if (notAuthenticated) return '/login';
return null;
},
);
Type-safe routing system with code generation using auto_route.
@RoutePage, @AutoRouterConfig.HomeRoute()).auto-route-navigation skill for full details.Low-level declarative API.
RouterDelegate and RouteInformationParser.Simple, context-less navigation.
GetMaterialApp.Get.to(), Get.off(), Get.toNamed().layer-based-clean-architecture | auto-route-navigation | security