What I learnt about Jetpack Compose Navigation🚀
🚀What you’ll learn ?
4 min readMay 16, 2024
- Navigation Fundamentals
- Task
- BackStack
- Navigation Best practices
- Passing arguments in Navigation
- Nested Navigation
- Navigation using Deep Linking
- Custom Navigation Components
🚀What is Jetpack Navigation?
How did I setup my navigation?
First I added the dependencies:
androidx-navigation-compose = "2.7.7" // replace with your latest versions
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidx-navigation-compose" }
Example: Imagine you have an app with the following screens:
I create a composable destinations for this screens:
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun HomeScreen(
modifier: Modifier = Modifier,
navController: NavHostController,
) {…