-
Notifications
You must be signed in to change notification settings - Fork 0
Navigation Controllers Hierarchy
Andrés Pedraza Míguez edited this page Dec 6, 2025
·
2 revisions
The app uses a nested navigation strategy to handle Bottom Tabs and full-screen flows properly.
- Scope: Global (The entire Activity).
-
Provider:
AppNavHost. -
Usage:
- Auth flows (Login -> Onboarding).
- Full-screen features that should cover the BottomBar (e.g., Settings, creating a new Group).
- Back navigation from "leaf" screens.
-
Scope: Local (Inside
MainScreentabs). -
Provider:
MainScreen. -
Usage:
- Navigation within a specific tab (e.g., Expenses List -> Expense Detail).
- Preserves the back stack of each tab independently.
We use CompositionLocal to access them easily in our composables without passing them down as parameters everywhere.
// To navigate to a full-screen feature (hiding bottom bar)
val rootNav = LocalRootNavController.current
rootNav.navigate(Routes.SETTINGS)
// To navigate inside the current tab
val tabNav = LocalTabNavController.current
tabNav.navigate(Routes.EXPENSE_DETAIL)