addChild method

void addChild(
  1. WidgetTreeNode child
)

Adds a child node to this widget tree node.

This method updates the list of children by adding child. The list of children remains unmodifiable to external modifications.

Implementation

void addChild(WidgetTreeNode child) {
  _children = List.unmodifiable([..._children, child]);
}