Answers for "jetpack compose navigation dependency"

0

jetpack compose navigation dependency

dependencies {
  // add the following dependecy on you app level gradle file.
  implementation "androidx.navigation:navigation-compose:2.4.0-alpha10"
}
Posted by: Guest on October-03-2021
0

jetpack compose navigation

val navController = rememberNavController()

NavHost(navController, startDestination = "profile") {
    composable("profile") { Profile(...) }
    composable("friendslist") { FriendsList(...) }
    ...
}

fun Profile(navController: NavController) {
    ...
    Button(onClick = { navController.navigate("friends") }) {
        Text(text = "Navigate next")
    }
    ...
}
Posted by: Guest on October-03-2021

Code answers related to "jetpack compose navigation dependency"

Browse Popular Code Answers by Language