insertAllAtFront method
Appends all nodes to the head of parent.
parent The parent node
newNode The node will be insert
closeCanInsert Can insert when parent closed
Implementation
void insertAllAtFront(NodeData? parent, List<NodeData> newNodes,
{bool closeCanInsert = false}) {
if (!closeCanInsert) {
if (parent != null && !isExpanded(parent)) {
return;
}
}
parent!.children.insertAll(0, newNodes);
_insertAllItemAtIndex(0, parent, newNodes);
notifyListeners();
}