styleSelected method

bool styleSelected({
  1. String? fill,
  2. CanvasImagePattern? pattern,
  3. String? stroke,
  4. double? lineWidth,
  5. String? font,
  6. bool clearFill = false,
  7. bool clearPattern = false,
  8. bool clearStroke = false,
})

Updates selected object style fields while preserving unspecified paint.

Implementation

bool styleSelected({
  String? fill,
  CanvasImagePattern? pattern,
  String? stroke,
  double? lineWidth,
  String? font,
  bool clearFill = false,
  bool clearPattern = false,
  bool clearStroke = false,
}) {
  return _updateSelectedObjects(
    (object) => _copyObjectWithPaint(
      object,
      object.paint.copyWith(
        fill: fill,
        pattern: pattern,
        stroke: stroke,
        lineWidth: lineWidth,
        font: font,
        clearFill: clearFill,
        clearPattern: clearPattern,
        clearStroke: clearStroke,
      ),
    ),
    skipLocked: true,
  );
}