move method
Reparents the node. This is a drag between containers.
Implementation
void move(String id, {required String parent, int? index}) {
final moving = find(id);
final target = find(parent);
if (moving == null || target == null) {
throw ArgumentError('No such node.');
}
// Dropping a container into its own subtree would orphan the tree.
if (_findIn(moving, parent) != null) {
throw ArgumentError(
'Cannot move a node into its own subtree.',
);
}
remove(id);
insert(moving, parent: parent, index: index);
}