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, Size minimumSize: const Size(20, 10), Size maximumSize: const Size(30, 15), double particleDrag: 0.05, Size canvas, Widget child})
const

Properties

blastDirection double
The blastDirection is 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.
final
blastDirectionality BlastDirectionality
The blastDirectionality is an enum that takes one of two values - directional or explosive. The default is set to directional
final
canvas Size
An optional parameter to specify the area size where the confetti will be thrown. By default this is set to screen size.
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
The ConfettiController must not be null.
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. Default is set to 0.02 (2% chance)
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. [...]
@nonVirtual, read-only, inherited
key Key
Controls how one widget replaces another widget in the tree. [...]
final, inherited
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. Cannot be null
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. Must be smaller than the maximumSize attribute. Cannot be null
final
numberOfParticles int
The numberOfParticles to be emitted per emission. Default is set to 10
final
particleDrag double
An optional parameter to specify drag force, effecting the movement of the confetti. Using 1.0 will give no drag at all, while, for example, using 0.1 will give a lot of drag. Default is set to 0.05.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
shouldLoop bool
The shouldLoop attribute determines if the emissionDuration will reset which will result in continues particles being emitted.
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. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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
Returns 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. [...]
@nonVirtual, inherited