Created
October 25, 2019 13:48
-
-
Save av/ffb7f0b4acd3353095ba60834fdd4c17 to your computer and use it in GitHub Desktop.
Flutter: magic, fading circle color
This file contains hidden or 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 FadingCircle extends Particle with Fading { | |
final double radius; | |
final Color color; | |
FadingCircle({ | |
this.radius = 10, | |
this.color = Colors.white, | |
}); | |
@override | |
void draw(Canvas canvas, Size size) { | |
canvas.drawCircle( | |
Offset.zero, | |
radius, | |
Paint()..color = color.withOpacity(opacity), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment