BottomDrawer
@OptIn(ExperimentalMaterialApi::class, ExperimentalMaterial3Api::class)
@Composable
fun Greeting(name: String) {
Column(Modifier.fillMaxSize()) {
val drawerState = rememberBottomDrawerState(BottomDrawerValue.Closed)
val scope = rememberCoroutineScope()
BottomDrawer(
modifier = Modifier
.fillMaxWidth()
.weight(1f),
drawerState = drawerState,
drawerShape = RoundedCornerShape(8.dp),
drawerBackgroundColor = Color.Magenta,
drawerContent = {
// Drawer content
var bools = mutableMapOf<Int, Boolean>()
LazyColumn(
modifier = Modifier
.fillMaxWidth()
.height((LocalConfiguration.current.screenHeightDp * 5 / 8).dp),
verticalArrangement = Arrangement.spacedBy(10.dp),
) {
//key = { it.id }
items(10) { index ->
bools[index] = false
var boolean by remember {
mutableStateOf(false)
}
Box(
Modifier
.fillMaxWidth()
.wrapContentHeight()
.background(Color.White, RoundedCornerShape(6.dp))
.defaultMinSize(minHeight = 50.dp)
.padding(horizontal = 12.dp)
.clickable {
boolean = !boolean
}
) {
Checkbox(checked = boolean, onCheckedChange = {
boolean = it
bools[index] = it