Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

flutter_confetti

blast some conf,etti all over the screen and celebrate user achievements!

getting started

to use this plugin, add conf,etti as a dependency in your pubspec.yaml file.

see the example to get started quickly.

to begin you need to instantiate a conf,etticontroller variable and pass in a duration argument. the conf,etticontroller can be instantiated in the initstate method and disposed in the dispose method.

in the build method return a confe,ttiwidget. the only attribute that is required is the confe,tticontroller.

other attributes that can be set are:

  • blastdirectionality -> an enum value to state if the particles shoot in random directions or a specific direction. blastdirectionality.explosive will shoot in random directions and don’t require a blastdirection to be set. blastdirectionality.directional requires a blastdirection to specify the direction of the confetti.
  • blastdirection -> a radial value to determine the direction of the particle emission. the default is set to pi (180 degrees). a value of pi will emit to the left of the canvas/screen.
  • emissionfrequency -> should be a value between 0 and 1. the higher the value the higher the likelihood that particles will be emitted on a single frame. default is set to 0.02 (2% chance)
  • numberofparticles -> the number of particles to be emitted per emission. default is set to 10
  • shouldloop -> determines if the emission will reset after the duration is completed, which will result in continues particles being emitted, and the animation looping
  • maxblastforce -> will determine the maximum blast force applied to a particle within it’s first 5 frames of life. the default maxblastforce is set to 20
  • minblastforce -> will determine the minimum blast force applied to a particle within it’s first 5 frames of life. the default minblastforce is set to 5
  • displaytarget -> if true a crosshair will be displayed to show the location of the particle emitter
  • colors -> a list of colors can be provided to manually set the confetti colors. if omitted then random colors will be used. a single color, for example [colors.blue], or multiple colors [colors.blue, colors.red, colors.green] can be provided as an argument in the `confettiwidget
  • minimumsize -> a size controlling the minimum possible size of the confetti. to be used in conjuction with maximumsize. for example, setting a minimumsize equal to size(10,10) will ensure that the confetti will never be smaller than the specified size. must be positive and smaller than the maximumsize. can not be null.
  • maximumsize -> a size controlling the maximum possible size of the confetti. to be used in conjuction with minimumsize. for example, setting a maximumsize equal to size(100,100) will create confetti with a size somewhere between the minimum and maximum size of (100, 100) [widht, height]. must be positive and bigger than the minimumsize, can not be null.
  • gravity -> change the speed at which the confetti falls. a value between 0 and 1. the higher the value the faster it will fall. default is set to 0.1
  • particledrag -> configure the drag force to apply to the confetti. a value between 0 and 1. a value of 1 will be no drag at all, while 0.1, for example, will be a lot of drag. default is set to 0.05
  • canvas -> set the size of the area where the confetti will be shown, by default this is set to full screen size.

enjoy the confetti.

note: don’t be greedy with the number of particles. the more particles that are on screen the more calculations need to be performed. performance improvements have been made, however this is still ongoing work. too many particles will result in performance issues. use wisely and carefully.


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.