Skip to content

Instantly share code, notes, and snippets.

@saqib-github-commits
Created August 20, 2023 17:36
Show Gist options
  • Save saqib-github-commits/f545141029ca2fda3db68211434496f4 to your computer and use it in GitHub Desktop.
Save saqib-github-commits/f545141029ca2fda3db68211434496f4 to your computer and use it in GitHub Desktop.
@Composable
fun MainNavigation(
navController: NavHostController = rememberNavController(),
drawerState: DrawerState = rememberDrawerState(initialValue = DrawerValue.Open)
) {
ModalNavigationDrawer(
drawerState = drawerState,
drawerContent = {
ModalDrawerSheet {
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.Green),
contentAlignment = Alignment.Center
) {
Text(text = "Drawer")
}
}
}
) {
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.Red),
contentAlignment = Alignment.Center
) {
Text(text = "Content Page")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment