insertAtRear method
Insert a node in the end
parent
The parent node
newNode
The node will be insert
closeCanInsert
Can insert when parent closed
Implementation
void insertAtRear(NodeData? parent, NodeData newNode,
{bool closeCanInsert = false}) {
if (!closeCanInsert) {
if (parent != null && !isExpanded(parent)) {
return;
}
}
parent!.children.add(newNode);
_insertItemAtIndex(0, parent, isFront: false);
notifyListeners();
}