does anyone know if it’s possible to show two diff...
# compose
a
does anyone know if it’s possible to show two different views in a
ModalBottomSheetLayout
? at the moment i only get the next view after the second click/compose
Copy code
var modalType: OptionSheet by remember { mutableStateOf(OptionSheet.Limits) }

    Log.e("type", modalType.toString())
    val state = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden)
    Surface(
        modifier = Modifier
            .fillMaxSize(),
        color = Color.shade000
    ) {
        ModalBottomSheetLayout(
            sheetState = state,
            sheetContent = {
                when (modalType) {
                    OptionSheet.Limits -> {
                        LazyColumn {
                            for (i in 1..5) item {
                                ListItem(
                                    text = { Text("Item $i") },
                                    icon = { Icon(Icons.Default.Favorite, "") }
                                )
                            }
                        }
                    }
                    else -> {
                        Box(modifier = Modifier.size(100.dp))
                    }
                }
            }
        ) {
            Column {
                Spacer(Modifier.preferredHeight(100.dp))
                Button({
                    withMutableSnapshot {
                        modalType = OptionSheet.Limits
                        state.show()
                    }
                }) {
                    Text("Modal one")
                }
                Spacer(Modifier.preferredHeight(100.dp))
                Button({
                    withMutableSnapshot {
                        modalType = OptionSheet.CompanyInfo
                        state.show()
                    }
                }) {
                    Text("Modal Two")
                }
            }

        }
    }
s
You have to do something like Sheet1 sheetContent1: Content1: Sheet2 SheetConent2: Content2:
k
I wanted to ask the same question. I think there is an issue with the animation being stopped when the content is being recomposed. Currently I am
LaunchedEffect
as a workaround.