drawEffect method

void drawEffect(
  1. Canvas canvas,
  2. Size size
)
override

Implementation

void drawEffect(Canvas canvas, Size size) {
  //BlendMode.srcOver so you cant see through the flame

  canvas.saveLayer(null, Paint()..blendMode = BlendMode.srcOver);
  //draw smoke particles
  for (EParticle eParticle in _smokeParticleList) {
    canvas.drawCircle(eParticle.position.getAbsolutePair(size).getOffset(),
        eParticle.radius, _smokePaint);
  }
  canvas.restore();
  canvas.saveLayer(null, Paint()..blendMode = BlendMode.srcOver);
  //draw flame particles
  for (EParticle eParticle in _flameParticleList) {
    canvas.drawCircle(eParticle.position.getAbsolutePair(size).getOffset(),
        eParticle.radius, _firePaint);
  }
  canvas.restore();
}