Fabio Grumiro
07/17/2023, 10:40 AMshow()
method should be used in order to animate the Material3 ModalBottomSheet
?
It seems that right now there is a bug that prevents the animation from working and even the official sample uses a boolean instead to open it:
https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]java/androidx/compose/material3/samples/BottomSheetSamples.ktFabio Grumiro
07/17/2023, 10:45 AMval sheetState = rememberModalBottomSheetState()
val scope = rememberCoroutineScope()
Button(onClick = {
scope.launch {
sheetState.show()
}
}) {
Text("Show sheet")
}
if (sheetState.isVisible) {
ModalBottomSheet(
sheetState = sheetState,
onDismissRequest = {
scope.launch {
sheetState.hide()
}
},
) {
// content
}