Listdetaildemo.mp4
val navController = rememberListDetailNavController()
ListDetailNavHost(
navController,
startDestination = "list1",
) {
list(
route = "list1",
content = { entry: NavBackStackEntry, showTwoPane: Boolean ->
// do something
},
placeholder = { entry: NavBackStackEntry, showTwoPane: Boolean ->
// do something
}
)
detail("detail1") { entry: NavBackStackEntry, showTwoPane: Boolean ->
// do something
}
detail("detail2") { entry: NavBackStackEntry, showTwoPane: Boolean ->
// do something
}
}
Back stack entries' lifecycle is managed by NavControl
in private. So, list pane lifecycle in two pane mode follows the lifecycle outside of the NavHost
.