reorder method
void
reorder()
Implementation
void reorder(
BuildContext context,
PageState state,
ID nodeID,
int newIndex,
int l,
Function(int, int) onReorder,
) {
var loop = l;
final node =
state.nodes.firstWhereOrNull((element) => element.id == nodeID);
if (node == null) throw Exception('No node found');
if (node.children == null) throw Exception('No children found');
onReorder(loop, newIndex);
/*Logger.printWarning('ReorderListViewAction $loop ${node.children!.length}');
final itemChildOne =
node.children![loop].copyWith(childOrder: newIndex.toDouble());
final itemChildTwo = node.children![newIndex]
.copyWith(childOrder: newIndex.toDouble() + 0.1);
context.read<TreeGlobalState>().onNodeUpdatedInPlayMode(
itemChildOne,
);
context.read<TreeGlobalState>().onNodeUpdatedInPlayMode(
itemChildTwo,
);*/
}