Skip to content

Instantly share code, notes, and snippets.

@florent37
Created December 12, 2018 15:02
Show Gist options
  • Save florent37/c7bc2ff50e1530d64510549d45d79a8c to your computer and use it in GitHub Desktop.
Save florent37/c7bc2ff50e1530d64510549d45d79a8c to your computer and use it in GitHub Desktop.
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