Created
July 22, 2021 12:18
-
-
Save Bharathh-Raj/a1ad713c935839cf292247d7326316b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void _drawHourText({required Canvas canvas, required int minute, required double theta}) { | |
final double fontSize = 12.0; | |
TextSpan span = | |
new TextSpan(style: new TextStyle(color: Colors.white, fontSize: fontSize), text: (minute ~/ 5).toString()); | |
TextPainter tp = new TextPainter( | |
text: span, | |
textAlign: TextAlign.center, | |
textDirection: TextDirection.ltr, | |
); | |
tp.layout(); | |
final Offset _pointToPositionText = | |
GetOffset.getOffsetWithRadiusAndTheta(radius: _getInnerPointRadiusOfMinuteLine(minute) - 12, theta: theta); | |
tp.paint(canvas, Offset(_pointToPositionText.dx - tp.width / 2, _pointToPositionText.dy - tp.height / 2)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment