ParticleOptions constructor

const ParticleOptions({
  1. Image? image,
  2. Color baseColor = Colors.black,
  3. double spawnMinRadius = 1.0,
  4. double spawnMaxRadius = 10.0,
  5. double spawnMinSpeed = 150.0,
  6. double spawnMaxSpeed = 300.0,
  7. double spawnOpacity = 0.0,
  8. double minOpacity = 0.1,
  9. double maxOpacity = 0.4,
  10. double opacityChangeRate = 0.25,
  11. int particleCount = 100,
})

Creates a ParticleOptions given a set of preferred values.

Default values are assigned for arguments that are omitted.

Implementation

const ParticleOptions({
  this.image,
  this.baseColor = Colors.black,
  this.spawnMinRadius = 1.0,
  this.spawnMaxRadius = 10.0,
  this.spawnMinSpeed = 150.0,
  this.spawnMaxSpeed = 300.0,
  this.spawnOpacity = 0.0,
  this.minOpacity = 0.1,
  this.maxOpacity = 0.4,
  this.opacityChangeRate = 0.25,
  this.particleCount = 100,
})  : assert(spawnMaxRadius >= spawnMinRadius),
      assert(spawnMinRadius >= 1.0),
      assert(spawnMaxRadius >= 1.0),
      assert(spawnOpacity >= 0.0),
      assert(spawnOpacity <= 1.0),
      assert(maxOpacity >= minOpacity),
      assert(minOpacity >= 0.0),
      assert(minOpacity <= 1.0),
      assert(maxOpacity >= 0.0),
      assert(maxOpacity <= 1.0),
      assert(spawnMaxSpeed >= spawnMinSpeed),
      assert(spawnMinSpeed >= 0.0),
      assert(spawnMaxSpeed >= 0.0),
      assert(particleCount >= 0);