alorma
04/24/2021, 11:19 AMalorma
04/24/2021, 11:27 AMval coroutineScope = rememberCoroutineScope()
val bottomSheetState = rememberModalBottomSheetState(
initialValue = ModalBottomSheetValue.Hidden,
)
ModalBottomSheetLayout(sheetContent = { Text("Hello!") }) {
Button(onClick = {
coroutineScope.launch {
if (bottomSheetState.isVisible) {
bottomSheetState.hide()
} else {
bottomSheetState.show()
}
}
}) {
if (bottomSheetState.isVisible) {
Text(text = "Hide")
} else {
Text(text = "Show")
}
}
}
ms
04/24/2021, 11:29 AMbottomSheetState
as parameter to ModalBottomSheetLayout
alorma
04/24/2021, 11:30 AMalorma
04/24/2021, 11:30 AMalorma
04/24/2021, 11:30 AMalorma
04/24/2021, 11:31 AM