SheetState

class SheetState(initialValue: SheetValue, animationSpec: AnimationSpec<Float> = SwipeableDefaults.AnimationSpec, val confirmStateChange: (SheetValue) -> Boolean = { true }) : SwipeableState<SheetValue>

Deprecated

SheetState is deprecated alongside BottomSheet component based on Material2. Migrate to Sheet based on Material3.

State of the SheetState composable.

Parameters

initialValue

The initial value of the state.

animationSpec

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

confirmStateChange

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

Constructors

Link copied to clipboard
constructor(initialValue: SheetValue, animationSpec: AnimationSpec<Float> = SwipeableDefaults.AnimationSpec, confirmStateChange: (SheetValue) -> Boolean = { true })

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Whether the sheet is visible.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun animateTo(targetValue: SheetValue, anim: AnimationSpec<Float>)
Link copied to clipboard
suspend fun hide()

Hide the sheet with animation and suspend until it if fully hidden or animation has been cancelled.

Link copied to clipboard
fun performDrag(delta: Float): Float
Link copied to clipboard
suspend fun performFling(velocity: Float)
Link copied to clipboard
suspend fun show()

Show the sheet with animation and suspend until it's shown.

Link copied to clipboard
suspend fun snapTo(targetValue: SheetValue)