withChildren method

Node withChildren(
  1. List<Node> kids
)

Only groups accept children; non-groups return themselves unchanged.

Implementation

Node withChildren(List<Node> kids) => switch (this) {
  final GroupNode n => n.copyWith(children: kids),
  _ => this,
};