addChild method

TreeElement<T> addChild(
  1. T child
)

Adds the child to this element

Implementation

TreeElement<T> addChild(T child) {
  children ??= <TreeElement<T>>[];
  final element = TreeElement(child, this);
  children!.add(element);
  return element;
}