ShellRoute + Home Route
core/routing/app_router.dart · ShellRoute
Overview
Wires the home route and almost every authenticated screen inside a single ShellRoute whose builder is AppShellScaffold. This is what makes the bottom nav persistent across pushes — secondary screens are children of the shell, not pushes on top of the home screen.
User Flow
- GoRouter is constructed in app_router.dart with the redirect we describe in the auth feature.
- Routes are split: auth/onboarding/splash live OUTSIDE the ShellRoute (no nav bar).
- Home, settings, cart, prestataires, profile, orders, seller dashboards, etc. live INSIDE the ShellRoute and inherit AppShellScaffold.
- Some routes (e.g. /map, /messages) are redirect-only GoRoutes that bounce back to /home so the IndexedStack can switch tabs.
Cases & Edge Cases
- Pushing onto a ShellRoute child preserves the nav bar; pushing the same route name from outside the shell breaks IndexedStack swap.
- The /add-prestation route lives outside the ShellRoute on purpose — it's a full-screen wizard that should NOT show the nav bar.
- /map and /messages exist as redirect-only routes purely to support deep-linking to a specific bottom-nav tab without a custom URL scheme.
Code References
- lib/src/core/routing/app_router.dart:332 // ShellRoute builder
- lib/src/core/routing/app_router.dart:338 // home GoRoute
- lib/src/core/routing/app_router.dart:344 // /map redirect
- lib/src/core/routing/app_router.dart:350 // /messages redirect
- lib/src/core/routing/app_router.dart:731 // /add-prestation outside ShellRoute
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
Adding a new top-level screen? Decide first whether it needs the nav bar — placement (inside vs outside ShellRoute) is the deciding factor.