addChild method

void addChild(
  1. RenderNode? node,
  2. int index
)

Implementation

void addChild(RenderNode? node, int index) {
  if (node != null) {
    _notifyManageChildren = true;
    if (index < 0 || index >= _children.length) {
      _children.add(node);
    } else {
      _children.insert(index, node);
    }

    node._parent = this;
    root.registerNode(node);
  }
}