copyWith method
Creates a copy of this sticky annotation with optional property overrides.
This is useful for creating variations of an existing sticky note or for implementing undo/redo functionality.
Implementation
StickyAnnotation copyWith({
String? id,
Offset? position,
String? text,
double? width,
double? height,
Color? color,
int? zIndex,
bool? isVisible,
bool? isInteractive,
Set<String>? dependencies,
Offset? offset,
Map<String, dynamic>? metadata,
}) {
return StickyAnnotation(
id: id ?? this.id,
position: position ?? currentPosition,
text: text ?? this.text,
width: width ?? this.width,
height: height ?? this.height,
color: color ?? this.color,
zIndex: zIndex ?? currentZIndex,
isVisible: isVisible ?? currentIsVisible,
isInteractive: isInteractive ?? this.isInteractive,
dependencies: dependencies ?? this.dependencies.toSet(),
offset: offset ?? this.offset,
metadata: metadata ?? this.metadata,
);
}