ConfettiWidget constructor

const ConfettiWidget(
  1. {Key key,
  2. @required ConfettiController confettiController,
  3. double emissionFrequency: 0.02,
  4. int numberOfParticles: 10,
  5. double maxBlastForce: 20,
  6. double minBlastForce: 5,
  7. BlastDirectionality blastDirectionality: BlastDirectionality.directional,
  8. double blastDirection: pi,
  9. double gravity: 0.2,
  10. bool shouldLoop: false,
  11. bool displayTarget: false,
  12. List<Color> colors,
  13. Size minimumSize: const Size(20, 10),
  14. Size maximumSize: const Size(30, 15),
  15. double particleDrag: 0.05,
  16. Size canvas,
  17. Widget child}
)

Implementation

const ConfettiWidget({
  Key key,
  @required this.confettiController,
  this.emissionFrequency = 0.02,
  this.numberOfParticles = 10,
  this.maxBlastForce = 20,
  this.minBlastForce = 5,
  this.blastDirectionality = BlastDirectionality.directional,
  this.blastDirection = pi,
  this.gravity = 0.2,
  this.shouldLoop = false,
  this.displayTarget = false,
  this.colors,
  this.minimumSize = const Size(20, 10),
  this.maximumSize = const Size(30, 15),
  this.particleDrag = 0.05,
  this.canvas,
  this.child,
})  : assert(
          confettiController != null,
          emissionFrequency != null &&
              numberOfParticles != null &&
              maxBlastForce != null &&
              minBlastForce != null &&
              blastDirectionality != null &&
              blastDirection != null),
      assert(emissionFrequency >= 0 &&
          emissionFrequency <= 1 &&
          numberOfParticles > 0 &&
          maxBlastForce > 0 &&
          minBlastForce > 0 &&
          maxBlastForce > minBlastForce),
      assert(gravity >= 0 && gravity <= 1),
      super(key: key);