Can ModalNavigationDrawers be used with NavControl...
# compose
m
Can ModalNavigationDrawers be used with NavControllers/NavHosts, or are they effectively mutually exclusive? Here was my idea: Scaffold with a TopAppBar and a menu icon that opens a ModalNavigationDrawer. When one of the NavigationDrawerItems is selected, the drawer closes, and the NavHost directs how to replace the main body content of the Scaffold, but the TopAppBar remains. Have I not figured out how to connect them, or are those navigation items not really compatible in the way I'm thinking about it?
h
The way I have this set up is with a global view model that handles the bottom sheet state and the selected item state. Then you will have a ModalBottomSheetLayout that is reused in each of your pages within your navHost, and when an item is selected in the bottom sheet, is passed to the
composable
as a navigation argument. I followed a jetpack compose navigation tutorial on medium, but can't find it now