drawParticle method

  1. @override
void drawParticle(
  1. Canvas canvas,
  2. Size size,
  3. FireParticle particle
)
override

During

Implementation

@override
void drawParticle(Canvas canvas, Size size, FireParticle particle) {
  canvas.save();
  canvas.translate(particle.x + screenX, particle.y + screenY);
  final s = particle.s * pow((particle.t + 1), 2);
  canvas.scale(s * particle.r3, s * particle.r3);
  double o = (1 - particle.t) / 5;

  canvas.drawCircle(
      Offset.zero,
      0.5,
      Paint()
        ..color = particle.c.withOpacity(o)
        ..blendMode = particle.m ? BlendMode.plus : BlendMode.colorBurn
        ..maskFilter = MaskFilter.blur(BlurStyle.normal, (particle.t) / 4));
  canvas.restore();
}