fillPaint method

void fillPaint(
  1. Paint paint, {
  2. Rect? rect,
  3. double? maxStrokeWidth,
  4. double? colorOP,
})

Implementation

void fillPaint(Paint paint, {Rect? rect, double? maxStrokeWidth, double? colorOP}) {
  paint.reset();
  paint.color = colorOP == null ? color : color.withOpacity(colorOP);
  paint.strokeCap = cap;
  paint.strokeJoin = join;
  paint.style = PaintingStyle.stroke;
  paint.strokeWidth = width;
  if (maxStrokeWidth != null && maxStrokeWidth > 0) {
    if (width > maxStrokeWidth) {
      paint.strokeWidth = maxStrokeWidth;
    }
  }

  if (shader != null && rect != null) {
    paint.shader = shader!.toShader(rect, colorOP);
  }
  if (shadow != null) {
    paint.color = shadow!.color;
    paint.maskFilter = MaskFilter.blur(shadow!.blurStyle, shadow!.blurSigma);
  }
}