onOptionsUpdate method
Implementation
@protected
@mustCallSuper
void onOptionsUpdate(ParticleOptions? oldOptions) {
if (particles == null) return;
if (particles!.length > options.particleCount)
particles!.removeRange(0, particles!.length - options.particleCount);
else if (particles!.length < options.particleCount) {
final int particlesToSpawn = options.particleCount - particles!.length;
final newParticles = generateParticles(particlesToSpawn);
particles!.addAll(newParticles);
}
}