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. 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,
  Map<String, dynamic>? metadata,
}) {
  return MarkerAnnotation(
    id: id ?? this.id,
    position: position ?? this.position,
    markerType: markerType ?? this.markerType,
    markerSize: size ?? markerSize,
    color: color ?? this.color,
    tooltip: tooltip ?? this.tooltip,
    zIndex: zIndex ?? this.zIndex,
    isVisible: isVisible ?? this.isVisible,
    isInteractive: isInteractive ?? this.isInteractive,
    metadata: metadata ?? this.metadata,
  );
}