setSelectedDrawingColor method

void setSelectedDrawingColor(
  1. Color color
)

Updates the color of the currently selected drawing.

Implementation

void setSelectedDrawingColor(Color color) {
  final sel = selectedDrawing;
  if (sel != null && !sel.isLocked) {
    recordDrawingSnapshot();
    final index = _drawings.indexWhere((d) => d.id == sel.id);
    if (index >= 0) {
      _drawings[index] = _drawings[index].copyWith(color: color);
      notifyListeners();
    }
  }
}