ConfettiWidget class

Inheritance

Constructors

ConfettiWidget({Key? key, required ConfettiController confettiController, double emissionFrequency = 0.02, int numberOfParticles = 10, double maxBlastForce = 20, double minBlastForce = 5, BlastDirectionality blastDirectionality = BlastDirectionality.directional, double blastDirection = pi, double gravity = 0.2, bool shouldLoop = false, bool displayTarget = false, List<Color>? colors, Color strokeColor = Colors.black, double strokeWidth = 0, Size minimumSize = const Size(20, 10), Size maximumSize = const Size(30, 15), double particleDrag = 0.05, Size? canvas, Widget? child, Path createParticlePath(Size size)?})
const

Properties

blastDirection double
The blastDirection is a radial value to determine the direction of the particle emission.
final
blastDirectionality BlastDirectionality
The blastDirectionality is an enum that takes one of two values - directional or explosive.
final
canvas Size?
An optional parameter to specify the area size where the confetti will be thrown.
final
child Widget?
Child widget to display
final
colors List<Color>?
List of Colors to iterate over - if null then random values will be chosen
final
confettiController ConfettiController
Controls the animation.
final
createParticlePath → (Path Function(Size size)?)
The createParticlePath is optional function that returns custom Path needed to generate particles.
final
displayTarget bool
The displayTarget attribute determines if a crosshair will be displayed to show the location of the particle emitter.
final
emissionFrequency double
The 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.
final
gravity double
The gravity is the speed at which the confetti will fall. The higher the gravity the faster it will fall.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxBlastForce double
The maxBlastForce and minBlastForce will determine the maximum and minimum blast force applied to a particle within it's first 5 frames of life. The default maxBlastForce is set to 20
final
maximumSize Size
An optional parameter to set the maximum potential size for the confetti. Must be bigger than the minimumSize attribute.
final
minBlastForce double
The maxBlastForce and minBlastForce will determine the maximum and minimum blast force applied to a particle within it's first 5 frames of life. The default minBlastForce is set to 5
final
minimumSize Size
An optional parameter to set the minimum size potential size for the confetti.
final
numberOfParticles int
The numberOfParticles to be emitted per emission.
final
particleDrag double
An optional parameter to specify drag force, effecting the movement of the confetti.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldLoop bool
The shouldLoop attribute determines if the animation will reset once it completes, resulting in a continuous particle emission.
final
strokeColor Color
Stroke color of the confetti (black by default, requires a strokeWidth > 0)
final
strokeWidth double
Stroke width of the confetti (0.0 by default, no stroke)
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _ConfettiWidgetState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited