copyWith method
Creates a copy of this comment node with optional property overrides.
This is useful for creating variations of an existing comment or for implementing undo/redo functionality.
Implementation
CommentNode<T> copyWith({
String? id,
Offset? position,
String? text,
T? data,
double? width,
double? height,
Color? color,
int? zIndex,
bool? isVisible,
bool? locked,
}) {
return CommentNode<T>(
id: id ?? this.id,
position: position ?? this.position.value,
text: text ?? this.text,
data: data ?? this.data,
width: width ?? this.width,
height: height ?? this.height,
color: color ?? this.color,
zIndex: zIndex ?? this.zIndex.value,
isVisible: isVisible ?? this.isVisible,
locked: locked ?? this.locked,
);
}