ParticleEffect constructor

ParticleEffect({
  1. ParticlePainter? particlePainter,
  2. int particleCount = 3,
  3. int speed = 1,
  4. double connectionOpacity = 0.3,
})

Creates a particle animation effect.

Parameters:

  • particlePainter: The painter to use for rendering particles. If null, defaults to CircleParticle.
  • particleCount: Number of particles traveling along the path. Default: 3
  • speed: Number of complete cycles per animation period. Default: 1
  • connectionOpacity: Opacity of the base connection (0.0-1.0). Default: 0.3

Implementation

ParticleEffect({
  ParticlePainter? particlePainter,
  this.particleCount = 3,
  this.speed = 1,
  this.connectionOpacity = 0.3,
}) : particlePainter = particlePainter ?? const CircleParticle(),
     assert(particleCount > 0, 'Particle count must be positive'),
     assert(speed > 0, 'Speed must be positive'),
     assert(
       connectionOpacity >= 0 && connectionOpacity <= 1.0,
       'Connection opacity must be between 0 and 1',
     );