withChild method

TreeNode withChild(
  1. TreeNode child
)

A copy with child appended to children.

Implementation

TreeNode withChild(TreeNode child) =>
    copyWith(children: [...children, child]);