drawMajorTickMarks method
void
drawMajorTickMarks(
{ - required Canvas canvas,
- required Size size,
})
Implementation
void drawMajorTickMarks({required Canvas canvas, required Size size}) {
final interval = getScaleInterval(size);
var majorTickMarkPosition = getScaleLowerLimit(size);
for (var i = 0; i < (divisions + 1); i++) {
final Offset majorTickMarksEndPoint =
Offset((size.width / 1.8) + gaugeStrokeWidth, majorTickMarkPosition);
final Offset majorTickMarksStartPoint = Offset(
(size.width / 2.0) - gaugeStrokeWidth / 2, majorTickMarkPosition);
final majorTickMarksPainter = Paint()
..color = Colors.grey.shade300
..strokeWidth = majorTickStrokeWidth;
canvas.drawLine(majorTickMarksStartPoint, majorTickMarksEndPoint,
majorTickMarksPainter);
majorTickMarkPosition = majorTickMarkPosition + interval;
}
}