copyWith method

StickyAnnotation copyWith({
  1. String? id,
  2. Offset? position,
  3. String? text,
  4. double? width,
  5. double? height,
  6. Color? color,
  7. int? zIndex,
  8. bool? isVisible,
  9. bool? isInteractive,
  10. Map<String, dynamic>? metadata,
})

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,
  );
}