copyWith method
Implementation
@override
TextNode copyWith({
String? type = 'text',
Iterable<Node>? children,
Attributes? attributes,
Delta? delta,
String? id,
}) {
final textNode = TextNode(
children: children ?? [],
attributes: attributes ?? this.attributes,
delta: delta ?? this.delta,
);
if (children == null && this.children.isNotEmpty) {
for (final child in this.children) {
textNode._children.add(
child.copyWith()..parent = textNode,
);
}
}
return textNode;
}