SwipeToDismissBoxState
State of the SwipeToDismissBox composable.
Parameters
The initial value of the state.
The density that this state can use to convert values to and from dp.
Optional callback invoked to confirm or veto a pending state change.
The positional threshold to be used when calculating the target state while a swipe is in progress and when settling after the swipe ends. This is the distance from the start of a transition. It will be, depending on the direction of the interaction, added or subtracted from/to the origin offset. It should always be a positive value.
Constructors
Properties
The current state value of the SwipeToDismissBoxState.
The direction (if any) in which the composable has been or is being dismissed.
The target state. This is the closest state to the current offset (taking into account positional thresholds). If no interactions like animations or drags are in progress, this will be the current state.
Functions
Dismiss the component in the given direction, with an animation and suspend. This method will throw CancellationException if the animation is interrupted
Require the current offset.
Set the state without any animation and suspend until it's set