removeAnnotation method

void removeAnnotation(
  1. String annotationId
)

Removes an annotation from the graph.

Triggers the onAnnotationDeleted callback after successful removal.

Parameters:

  • annotationId: The ID of the annotation to remove

Implementation

void removeAnnotation(String annotationId) {
  final annotationToDelete = annotations.getAnnotation(annotationId);
  annotations.removeAnnotation(annotationId);
  // Fire callback after successful removal
  if (annotationToDelete != null) {
    callbacks.onAnnotationDeleted?.call(annotationToDelete);
  }
}