ReorderCallback typedef

ReorderCallback = void Function(int oldIndex, int newIndex)

A callback used by ReorderableList to report that a list item has moved to a new position in the list.

Implementations should remove the corresponding list item at oldIndex and reinsert it at newIndex.

link
final List<MyDataObject> backingList = <MyDataObject>[/* ... */];

void handleReorderItem(int oldIndex, int newIndex) {
  final MyDataObject element = backingList.removeAt(oldIndex);
  backingList.insert(newIndex, element);
}

See also:

Implementation

typedef ReorderCallback = void Function(int oldIndex, int newIndex);