Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iamutkarshtiwari/b0a5da2945d056c3b0a291ffa432617c to your computer and use it in GitHub Desktop.
Save iamutkarshtiwari/b0a5da2945d056c3b0a291ffa432617c to your computer and use it in GitHub Desktop.
ModalBottomSheetLayout Scrim Issue
@OptIn(ExperimentalMaterialApi::class)
@Composable
private fun SetupModal() {
val state = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden)
val scope = rememberCoroutineScope()
ModalBottomSheetLayout(
sheetState = state,
sheetContent = {
PrimaryButton(
text = "Hello",
onClick = {
}
)
PrimaryButton(
text = "Elon's",
onClick = {
}
)
PrimaryButton(
text = "World",
onClick = {
}
)
}
) {
Column(
modifier = Modifier.fillMaxSize().padding(16.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
Text("Rest of the UI")
Spacer(Modifier.height(20.dp))
Button(onClick = { scope.launch { state.show() } }) {
Text("Click to show sheet")
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment