Custom Bottom Sheet
Customizes the standard BottomSheetScaffold by modifying how the sheet's offset is calculated.
The offset is a value between 0 and 1:
0
: Indicates the bottom sheet is collapsed.1
: Indicates the bottom sheet is fully visible.
The offset is also 0
if the bottom sheet is collapsed but remains visible due to its sheetPeekHeight
.
The sheet layout adapts to the screen orientation:
In portrait mode, it occupies the full width of the screen.
In landscape mode, it occupies half the screen width and is aligned to the left side with 15px padding from the left.
Additionally, this implementation fades the background when the bottom sheet is expanded. Clicking the fader collapses the bottom sheet automatically.
Parameters
Manages the state and behavior of the BottomSheetScaffold.
Callback triggered when the collapse state changes.
The height of the bottom sheet when it is collapsed.
The color of the fade effect when the bottom sheet is expanded.
The composable content displayed inside the bottom sheet.