How can we show ModalBottomSheet using Compose Nav...
# compose
c
How can we show ModalBottomSheet using Compose Navigation? This is how my Modal sheet looks like:
Copy code
fun AddressPicker(
    sheetState: ModalBottomSheetState,
    onConfirm: (Address) -> Unit
) {
    ModalBottomSheetLayout(
        sheetState = sheetState,
        sheetContent = { AddressForm(onConfirm) }
    ) {}
}
Then I added this into my nav graph:
Copy code
composable(route = Screen.AddressPickerScreen.route) {
    AddressPicker(sheetState = sheetState) {
       // ...
    }
}
And to show it, I used below code:
Copy code
navController.navigate(Screen.AddressPickerScreen.route)
Instead of showing the sheet content, it shows a blank canvas. What am I doing wrong?
j
We have Accompanist Nav Material to help you with that! Beware that it has some issues we are still working out though; it works best if your sheet content is static.
c
This worked beautifully. Thanks @jossiwolf
🙌 1