Created
February 15, 2026 07:18
-
-
Save skydoves/ade2dfd0312cda0255900b7ab0fe5875 to your computer and use it in GitHub Desktop.
FlexibleBottomSheet - Programmatic state control
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val sheetState = rememberFlexibleBottomSheetState( | |
| isModal = false, | |
| skipSlightlyExpanded = false, | |
| ) | |
| val scope = rememberCoroutineScope() | |
| // Expand to full height | |
| Button(onClick = { scope.launch { sheetState.fullyExpand() } }) { | |
| Text("Expand") | |
| } | |
| // Collapse to peek state | |
| Button(onClick = { scope.launch { sheetState.slightlyExpand() } }) { | |
| Text("Collapse") | |
| } | |
| // Hide completely | |
| Button(onClick = { scope.launch { sheetState.hide() } }) { | |
| Text("Hide") | |
| } | |
| // Show at the best available state | |
| Button(onClick = { scope.launch { sheetState.show() } }) { | |
| Text("Show") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment