copyWith method

MarkerAnnotation copyWith({
  1. String? id,
  2. Offset? position,
  3. MarkerType? markerType,
  4. double? size,
  5. Color? color,
  6. String? tooltip,
  7. int? zIndex,
  8. bool? isVisible,
  9. bool? isInteractive,
  10. Set<String>? dependencies,
  11. Map<String, dynamic>? metadata,
})

Creates a copy of this marker annotation with optional property overrides.

This is useful for creating variations of an existing marker or for implementing undo/redo functionality.

Implementation

MarkerAnnotation copyWith({
  String? id,
  Offset? position,
  MarkerType? markerType,
  double? size,
  Color? color,
  String? tooltip,
  int? zIndex,
  bool? isVisible,
  bool? isInteractive,
  Set<String>? dependencies,
  Map<String, dynamic>? metadata,
}) {
  return MarkerAnnotation(
    id: id ?? this.id,
    position: position ?? currentPosition,
    markerType: markerType ?? this.markerType,
    markerSize: size ?? markerSize,
    color: color ?? this.color,
    tooltip: tooltip ?? this.tooltip,
    zIndex: zIndex ?? currentZIndex,
    isVisible: isVisible ?? currentIsVisible,
    isInteractive: isInteractive ?? this.isInteractive,
    dependencies: dependencies ?? this.dependencies.toSet(),
    metadata: metadata ?? this.metadata,
  );
}