onReorder property

OnReorder<K>? onReorder
final

A callback used by the list to report that a list item has been dragged and dropped to a new location in the list and the application should update the order of the items.

The dragged item is available as onReorderParam.item.

The from and to are the indexes of the items are available with onReorderParam.oldIndex and onReorderParam.newIndex.

The "new" previous and next items (items before and after the drop position) are available with onReorderParam.newPreviousItem and onReorderParam.newNextItem (both nullable). onReorderParam.newPreviousItem will be null if the item is dropped at the beginning of the list while onReorderParam.newNextItem will be null if the item is dropped at the end of the list.

Implementation

final OnReorder<K>? onReorder;