Skip to content

Latest commit

 

History

History
31 lines (27 loc) · 902 Bytes

ListDetail.md

File metadata and controls

31 lines (27 loc) · 902 Bytes

ListDetail

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
    }
}

Limitations

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.