ClockPainter constructor
ClockPainter(})
Implementation
ClockPainter(this.datetime,
{this.radius = 150.0,
this.handColor = Colors.black,
this.numberColor = Colors.black,
this.borderColor = Colors.black,
Color color = Colors.red,
double strokeWidth = 1.0})
: super(color: color, strokeWidth: strokeWidth) {
borderWidth = radius / 14;
final secondDistance = radius - borderWidth * 2;
for (var i = 0; i < 60; i++) {
Offset offset = Offset(
cos(degToRad(6 * i - 90)) * secondDistance + radius,
sin(degToRad(6 * i - 90)) * secondDistance + radius);
secondsOffset.add(offset);
}
textPainter = TextPainter(
textAlign: TextAlign.center,
textDirection: TextDirection.rtl,
);
angle = degToRad(360 / 60).toDouble();
}