LinearPainter constructor
LinearPainter({
- double? circleWidth,
- double? progress,
- Widget? child,
- bool? fromRightToLeft,
- Color? progressBarColor,
- Color? backgroundColor,
- GFProgressHeadType? progressHeadType,
- LinearGradient? linearGradient,
- MaskFilter? mask,
- bool? clipLinearGradient,
Implementation
LinearPainter({
this.circleWidth,
this.progress,
this.child,
this.fromRightToLeft,
this.progressBarColor,
this.backgroundColor,
this.progressHeadType,
this.linearGradient,
this.mask,
this.clipLinearGradient,
}) {
_paintBackground.color = backgroundColor!;
_paintBackground.style = PaintingStyle.stroke;
_paintBackground.strokeWidth = circleWidth!;
_paintLine.color = progress.toString() == '0.0' && progressBarColor != null
? progressBarColor!.withOpacity(0)
: progressBarColor!;
_paintLine.style = PaintingStyle.stroke;
_paintLine.strokeWidth = circleWidth!;
if (progressHeadType == GFProgressHeadType.square) {
_paintLine.strokeCap = StrokeCap.butt;
} else {
_paintLine.strokeCap = StrokeCap.round;
_paintBackground.strokeCap = StrokeCap.round;
}
}