This is a tutorial on how to create a Navigation component in Android JetPack Compose. With navigation in Jetpack Compose we need some core elements which are:
- a class that will hold the routes in this case, we have used a sealed class called NavigationClass.
- create objects that will inherit from that navigation class
- create the composables/screens you want to navigate between and link them with the routes using the NaVHost and NavHostController.
- create a navigation Bar composables for each of the screens.
- create a scaffold that will take the navigation bar composable as an argument for the bottomBar lambda
- Voila! You have a navigation app…