QuantityPickerState

The QuantityPickerState class is useful to handle the QuantityPicker component lifecycle

Author

N7ghtm4r3 - Tecknobit

Since

1.1.0

Properties

Link copied to clipboard

The current quantity picked

Link copied to clipboard

The initial quantity selected

Link copied to clipboard

longPressEnabled whether the longPressQuantity option is enabled

Link copied to clipboard
val longPressQuantity: Int? = null

The quantity to decrement or increment when the user long press (or double-clicked) the quantity buttons

Link copied to clipboard

The maximum threshold quantity allowed

Link copied to clipboard

The minimum threshold quantity allowed

Link copied to clipboard
private val quantity: MutableState<Int>

quantity the state used to manage the quantity picked

Link copied to clipboard

quantityPicked the current quantity picked

Functions

Link copied to clipboard
private fun decrement(decrementValue: Int)

Method used to decrement the quantity value

Link copied to clipboard
private fun increment(incrementValue: Int)

Method used to increment the quantity value

Link copied to clipboard

Method used to decrement the quantity value by the amount specified in longPressQuantity

Link copied to clipboard

Method used to increment the quantity value by the amount specified in longPressQuantity

Link copied to clipboard
fun reset()

Method used to reset the current quantity picked as the initialQuantity amount

Link copied to clipboard

Method used to simply decrement the quantity value by one

Link copied to clipboard

Method used to simply increment the quantity value by one