drag To Reorder
fun <T> Modifier.dragToReorder(item: T, itemList: List<T>, itemHeight: Int, updateSlideState: (item: T, slideState: SlideState) -> Unit, onStartDrag: (currIndex: Int) -> Unit = {}, onDrag: (dy: Float, currIndex: Int, destIndex: Int) -> Unit = { _, _, _ -> }, onStopDrag: (currIndex: Int, destIndex: Int) -> Unit): Modifier
Adds a drag-to-reorder functionality to the given modifier.
Return
A modifier that adds drag-to-reorder functionality.
Parameters
item
The item to be dragged.
item List
The list of items to which the item belongs.
item Height
The height of each item in the list in pixels.
update Slide State
A callback function to update the slide state of an item.
on Start Drag
A callback function to be invoked when the drag operation starts and provides the starting index.
on Drag
A callback function to be invoked during the dragging operation
on Stop Drag
A callback function to be invoked when the drag operation ends.