removeDrawing method

void removeDrawing(
  1. String id
)

Removes a drawing from the chart canvas.

Implementation

void removeDrawing(String id) {
  final removed = _drawings.where((d) => d.id == id).toList();
  if (removed.isNotEmpty) {
    recordDrawingSnapshot();
    _drawings.removeWhere((d) => d.id == id);
    onDrawingRemoved?.call(id);
    notifyListeners();
    triggerAutoSave();
  }
}