LinearPainter constructor

LinearPainter({
  1. double? circleWidth,
  2. double? progress,
  3. Widget? child,
  4. bool? fromRightToLeft,
  5. Color? progressBarColor,
  6. Color? backgroundColor,
  7. GFProgressHeadType? progressHeadType,
  8. LinearGradient? linearGradient,
  9. MaskFilter? mask,
  10. 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;
  }
}