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 ?? Colors.transparent;
_paintBackground.style = PaintingStyle.stroke;
_paintBackground.strokeWidth = circleWidth ?? 0.0;
_paintLine.color = progress.toString() == '0.0' && progressBarColor != null
? progressBarColor ?? Colors.transparent.withOpacity(0)
: progressBarColor ?? Colors.transparent;
_paintLine.style = PaintingStyle.stroke;
_paintLine.strokeWidth = circleWidth ?? 0.0;
if (progressHeadType == GFProgressHeadType.square) {
_paintLine.strokeCap = StrokeCap.butt;
} else {
_paintLine.strokeCap = StrokeCap.round;
_paintBackground.strokeCap = StrokeCap.round;
}
}