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. Color strokeColor = Colors.black,
  14. double strokeWidth = 0,
  15. Size minimumSize = const Size(20, 10),
  16. Size maximumSize = const Size(30, 15),
  17. double particleDrag = 0.05,
  18. Size? canvas,
  19. Widget? child,
  20. Path createParticlePath(
    1. Size size
    )?}
)

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.strokeColor = Colors.black,
  this.strokeWidth = 0,
  this.minimumSize = const Size(20, 10),
  this.maximumSize = const Size(30, 15),
  this.particleDrag = 0.05,
  this.canvas,
  this.child,
  this.createParticlePath,
})  : assert(
        emissionFrequency >= 0 &&
            emissionFrequency <= 1 &&
            numberOfParticles > 0 &&
            maxBlastForce > 0 &&
            minBlastForce > 0 &&
            maxBlastForce > minBlastForce,
      ),
      assert(gravity >= 0 && gravity <= 1,
          '`gravity` needs to be between 0 and 1'),
      assert(strokeWidth >= 0, '`strokeWidth needs to be bigger than 0'),
      super(key: key);