addViewModel method
Implementation
void addViewModel(RenderViewModel child, int index) {
var oldParent = child.parent;
if (oldParent != null && oldParent is GroupViewModel) {
oldParent.removeViewModel(child);
}
child.parent = this;
if (index > childCount || index < 0) {
_children.add(child);
} else {
_children.insert(index, child);
}
_childrenMap[child.id] = child;
}