Created
December 12, 2018 15:02
-
-
Save florent37/c7bc2ff50e1530d64510549d45d79a8c 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
class MyPainter extends CustomPainter { | |
... | |
@override | |
void paint(Canvas canvas, Size size) { | |
final line = Paint() | |
..color = lineColor | |
..strokeCap = StrokeCap.round | |
..style = PaintingStyle.stroke | |
..strokeWidth = width; | |
final center = Offset(size.width/2, size.height/2); | |
final radius = min(size.width/2, size.height/2); | |
canvas.drawCircle( | |
center, | |
radius, | |
line | |
); | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment