paintBar method
Implementation
Paint paintBar(Size size) {
final Paint paint = Paint()
..strokeWidth = strokeWidth
..color = solidBarColor
..style = PaintingStyle.stroke
..strokeCap = barStrokeCap;
if (gradientBarColor != null) {
// apply gradient color if it's not null
final Rect rect = Rect.fromCircle(
center: Offset(size.width / 2, size.width / 2),
radius: size.width,
);
paint.shader = gradientBarColor!.createShader(rect);
}
return paint;
}