copyWith method
Create a copy of this node with updated fields
Implementation
Node copyWith({
String? id,
String? root,
String? previous,
String? pathHash,
Map<String, dynamic>? content,
}) {
final newContent = NodeContent();
final contentToUse = content ?? contentMap;
contentToUse.forEach((key, value) {
newContent[key] = value;
});
return Node(
id: id ?? this.id,
root: root ?? this.root,
previous: previous ?? this.previous,
pathHash: pathHash ?? this.pathHash,
content: newContent,
);
}