fillPaint method

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

Implementation

void fillPaint(Paint paint, Rect? rect, {double? colorOpacity}) {
  paint.reset();
  if (color != null) {
    if (colorOpacity != null) {
      paint.color = color!.withOpacity(colorOpacity);
    } else {
      paint.color = color!;
    }
  }
  if (shader != null && rect != null) {
    paint.shader = shader!.toShader(rect, colorOpacity);
  }
}