remember Modal Bottom Sheet State
fun rememberModalBottomSheetState(initialDetent: SheetDetent, detents: List<SheetDetent> = listOf(SheetDetent.Hidden, SheetDetent.FullyExpanded), animationSpec: AnimationSpec<Float> = tween(), velocityThreshold: () -> Dp = { 125.dp }, positionalThreshold: (totalDistance: Dp) -> Dp = { 56.dp }, confirmDetentChange: (SheetDetent) -> Boolean = { true }, decayAnimationSpec: DecayAnimationSpec<Float> = rememberSplineBasedDecay()): ModalBottomSheetState
Creates a ModalBottomSheetState that is remembered across compositions.
Return
A remembered ModalBottomSheetState instance.
Parameters
initial Detent
The initial detent of the sheet.
detents
The list of detents that the sheet can snap to.
animation Spec
The animation spec to use for animating between detents.
velocity Threshold
The velocity threshold for determining whether to snap to the next detent.
positional Threshold
The positional threshold for determining whether to snap to the next detent.
confirm Detent Change
Callback to confirm whether a detent change should be allowed.
decay Animation Spec
The animation spec to use for decay animations.