BottomSheetState

class BottomSheetState(initialValue: BottomSheetValue, animationSpec: <Error class: unknown class><Float> = SwipeableDefaults.AnimationSpec, confirmValueChange: (BottomSheetValue) -> Boolean = { true })

State of the persistent bottom sheet in ScanbotScaffold.

Parameters

initialValue

The initial value of the state.

animationSpec

The default animation that will be used to animate to a new state.

confirmValueChange

Optional callback invoked to confirm or veto a pending state change.

Constructors

Link copied to clipboard
constructor(initialValue: BottomSheetValue, animationSpec: <Error class: unknown class><Float> = SwipeableDefaults.AnimationSpec, confirmValueChange: (BottomSheetValue) -> Boolean = { true })

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard

Whether the bottom sheet is collapsed.

Link copied to clipboard

Whether the bottom sheet is expanded.

Link copied to clipboard
Link copied to clipboard

The fraction of the progress going from currentValue to the targetValue, within 0f..1f bounds, or 1f if the sheet is in a settled state.

Functions

Link copied to clipboard
suspend fun collapse()

Collapse the bottom sheet with animation and suspend until it if fully collapsed or animation has been cancelled. This method will throw CancellationException if the animation is interrupted.

Link copied to clipboard
suspend fun expand()

Expand the bottom sheet with an animation and suspend until the animation finishes or is cancelled. Note: If the pick height is equal to the sheet height, this method will animate to the Collapsed state.

Link copied to clipboard

Require the current offset.