insertAtIndex method
Inserts a node at position index
in parent.
The index
value must be non-negative and no greater than length
.
Implementation
void insertAtIndex(int index, dynamic parent, NodeData newNode,
{bool closeCanInsert = false}) {
assert(index <= parent.children.length);
if (!closeCanInsert) {
if (parent != null && !isExpanded(parent)) {
return;
}
}
parent.children.insert(index, newNode);
_insertItemAtIndex(index, parent, isIndex: true);
notifyListeners();
}