copyWith method
Implementation
NodeV0 copyWith({
String? type,
LinkedList<NodeV0>? children,
Attributes? attributes,
}) {
final node = NodeV0(
type: type ?? this.type,
attributes: attributes ?? {...this.attributes},
children: children,
);
if (children == null && this.children.isNotEmpty) {
for (final child in this.children) {
node.children.add(
child.copyWith()..parent = node,
);
}
}
return node;
}