I just learned about making Analog Clock with flutter CustomPainter, and I know to make every hour mark with canvas.drawline(p1, p2, dashBrush)
.
this is my Analog clock hour mark code :
var outerCircleRadius = radius;
var innerCircleRadius = radius - 14;
for (double i = 0; i < 360; i += 90 / 3) {
var x1 = centerX + outerCircleRadius * cos(i * pi / 180);
var y1 = centerX + outerCircleRadius * sin(i * pi / 180);
var x2 = centerX + innerCircleRadius * cos(i * pi / 180);
var y2 = centerX + innerCircleRadius * sin(i * pi / 180);
//Draw Hour line is hire
canvas.drawLine(Offset(x1, y1), Offset(x2, y2), dashBrush);
}
How do I change from drawLine dashBrush to an hour number?