BurstEmitter class

An emitter that fires a fixed number of particles in a burst.

Supports instant, delayed, and repeating bursts with configurable spread patterns. Burst particles are additive — they do not interfere with the main particle pool.

See also Emitter.burst for a factory-constructor shorthand.

Constructors

BurstEmitter({required Offset position(Size size), required int particleCount, required Particle particleFactory(int index, int total), required BurstPattern pattern, Duration initialDelay = Duration.zero, int repeatCount = 1, Duration repeatInterval = Duration.zero, double positionRadius = 0.0, ParticlePhysics? physics, bool enableTrails = false, BurstEmitterController? controller, int maxPoolSize = 500})

Properties

controller BurstEmitterController?
Optional controller for manual triggering.
final
enableTrails bool
Trails are off by default — trails on hundreds of particles are expensive.
final
hashCode int
The hash code for this object.
no setterinherited
initialDelay Duration
Delay before the first burst fires.
final
maxPoolSize int
Hard ceiling on live + dead particles retained by this emitter.
final
particleCount int
Number of particles emitted per burst.
final
particleFactory Particle Function(int index, int total)
Called once per particle to produce its appearance. Engine sets position and velocity after this returns.
final
particles List<Particle>
Returns the live burst particle pool (may be null before first burst).
no setter
pattern BurstPattern
Velocity spread strategy for burst particles.
final
physics ParticlePhysics?
Per-burst physics. Null = no gravity on burst particles.
final
position Offset Function(Size size)
Burst origin as a function of widget size, e.g. (size) => size.center(Offset.zero).
final
positionRadius double
Scatter radius around position for spawn point.
final
repeatCount int
How many times to repeat. 0 = infinite.
final
repeatInterval Duration
Interval between repeats.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
Stops the auto-fire loop and releases the particle pool. Call when the emitter is no longer used (e.g. widget disposed or scene swap).
initialize(Size size) → void
Called once by the engine after the widget lays out.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
tickController(Size size) → void
Called every frame by the engine to handle controller triggers.
toString() String
A string representation of this object.
inherited
updateParticles(double deltaTime, double width, double height, Size size) → void
Per-frame update for burst particles. Called by engine's _engine() loop.

Operators

operator ==(Object other) bool
The equality operator.
inherited