Jetpack Compose ModalBottomSheetLayout Sample

@Composablefun CardScreen() {    val scaffoldState = rememberScaffoldState()    val modalBottomSheetState = rememberModalBottomSheetState(ModalBottomSheetValue.Hidden)    val coroutineScope = rememberCoroutineScope()    Scaffold(        scaffoldState = scaffoldState,    ) { innerPadding ->        Box(modifier = Modifier.padding(innerPadding)) {            Button(onClick = {                coroutineScope.launch {                  modalBottomSheetState.show()                }            }) {                Text(text = "Show")            }        }    }    ModalBottomSheetLayout(          sheetState = modalBottomSheetState,          sheetContent = {              LazyColumn {                  item {                      TextButton(modifier = Modifier.fillMaxWidth(), onClick = {                          // do something                      }) {                          Row {                              Icon(                                  imageVector = Icons.Filled.Add,                                  // painterResource(id = R.drawable.ic_baseline_add_24),                                  contentDescription = "New Album"                              )                              Text("New Album")                              Spacer(modifier = Modifier.weight(1f))                          }                      }                  }              }          }      ) {          // you can also opt to put screen composable / scaffold here      }}

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.