Djuro
03/11/2024, 3:00 PMsheetPeekHeight
be so that it fills the remaining space of the scaffold?
I don't want a fixed value. I just want to have it as a Column
and then fill the whole screen when user drags up. Any ideas?Djuro
03/12/2024, 9:48 AMheight
of all your components on the screen. I used BoxWithConstraints
to get maxHeight
BoxWithConstraints {
val boxWithConstraintsScope = this
Column(modifier = modifier.fillMaxSize().padding(horizontal = 10.dp)) {
Text(text = "content outside the bottom sheet", modifier = Modifier.height(20.dp))
}
BottomSheetScaffold(
modifier = Modifier.fillMaxHeight(),
scaffoldState = sheetState,
sheetContent = {
Text("Bottom sheet content", modifier = Modifier.fillMaxHeight())
},
sheetPeekHeight = boxWithConstraintsScope.maxHeight - 20.dp,
sheetContainerColor = MaterialTheme.colorScheme.primary,
sheetShape = RectangleShape,
) {
// no content, sheet should always be displayed
}
}