Skip to content

Instantly share code, notes, and snippets.

@alohaabhi
Last active May 11, 2020 06:55
Show Gist options
  • Save alohaabhi/ffe14a53794c4e4b2c9b73ee9d5124f9 to your computer and use it in GitHub Desktop.
Save alohaabhi/ffe14a53794c4e4b2c9b73ee9d5124f9 to your computer and use it in GitHub Desktop.
class DrawCircle extends CustomPainter {
Paint circlePaint;
final radius;
DrawCircle(Color color, this.radius) {
this.circlePaint = Paint()
..color = color
..style = PaintingStyle.fill;
}
@override
void paint(Canvas canvas, Size size) {
canvas.drawCircle(Offset(0.0, 0.0), radius, circlePaint);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment