Skip to content
Discussion options

You must be logged in to vote

Navigator(HomeScreen) creates the navigation scope and initial stack. CurrentScreen() is the rendering slot for the top of that stack. They do not have to be adjacent: your drawer can sit between them.

Move the Navigator above the shared Scaffold, then put CurrentScreen() where your NavHost was:

val drawerState = rememberDrawerState(DrawerValue.Closed)

Navigator(HomeScreen) {
    Scaffold(
        topBar = { TopBar(drawerState = drawerState) },
    ) { innerPadding ->
        ModalNavigationDrawer(
            modifier = Modifier
                .padding(innerPadding)
                .fillMaxSize(),
            drawerState = drawerState,
            gesturesEnabled = false,
            d…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wlmirand
Comment options

Answer selected by wlmirand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants