I try to create a reorderable list in Flutter with the ReorderableListView widget:
return ReorderableListView(
onReorder: (int index, int targetPosition) {
print(index.toString() + " -> " + targetPosition.toString());
}
...
I can´t find an exact explanation of what the two arguments in onReorder are. I found some "oldIndex", "newIndex" staff - but that doesn´t look like it´s correct.
I´ve build an example with a List with three items. When I drag the items I get the following (for me confusing) results:
Position 1 -> Position 2 results in 0 -> 2
Position 1 -> Position 3 results in 0 -> 3
Position 3 -> Position 1 results in 2 -> 1
For me, it looks like a mixup of index and position...
Maybe someone has an idea what´s my mistake?