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,
Map<String, dynamic>? metadata,
}) {
return StickyAnnotation(
id: id ?? this.id,
position: position ?? this.position,
text: text ?? this.text,
width: width ?? this.width,
height: height ?? this.height,
color: color ?? this.color,
zIndex: zIndex ?? this.zIndex,
isVisible: isVisible ?? this.isVisible,
isInteractive: isInteractive ?? this.isInteractive,
metadata: metadata ?? this.metadata,
);
}