copyWith method
TextNodeV0
copyWith({
- String? type = 'text',
- LinkedList<
NodeV0> ? children, - Attributes? attributes,
- Delta? delta,
override
Implementation
@override
TextNodeV0 copyWith({
String? type = 'text',
LinkedList<NodeV0>? children,
Attributes? attributes,
Delta? delta,
}) {
final textNode = TextNodeV0(
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;
}