Skip to content

Instantly share code, notes, and snippets.

@av
Created October 25, 2019 13:48
Show Gist options
  • Save av/ffb7f0b4acd3353095ba60834fdd4c17 to your computer and use it in GitHub Desktop.
Save av/ffb7f0b4acd3353095ba60834fdd4c17 to your computer and use it in GitHub Desktop.
Flutter: magic, fading circle color
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