LinearPainter constructor

LinearPainter({
  1. required double lineThickness,
  2. required double progress,
  3. required Color progressColor,
  4. required Color backgroundColor,
})

Implementation

LinearPainter({
  required this.lineThickness,
  required this.progress,
  required this.progressColor,
  required this.backgroundColor,
}) {
  _paintBackground.color = backgroundColor;
  _paintBackground.style = PaintingStyle.stroke;
  _paintBackground.strokeWidth = lineThickness;

  _paintLine.color = progress.toString() == '0.0'
      ? progressColor.withOpacity(0.0)
      : progressColor;
  _paintLine.style = PaintingStyle.stroke;
  _paintLine.strokeWidth = lineThickness;

  _paintLine.strokeCap = StrokeCap.butt;
}