AppConfetti class

A highly customizable, dependency-free Confetti overlay component. It wraps a child widget and draws a physics-based explosion of confetti over the child when isShooting becomes true.

Inheritance

Constructors

AppConfetti({Key? key, required Widget child, required bool isShooting, int particleCount = 100, Duration duration = const Duration(seconds: 4), List<Color> colors = const [AppColors.red500, AppColors.emerald500, AppColors.blue500, AppColors.yellow500, AppColors.pink500, AppColors.purple500, AppColors.orange500], double gravity = 9.8, double blastVelocity = 20.0, bool fullScreen = false})
const

Properties

blastVelocity double
The initial explosion burst force. Higher numbers mean particles shoot further.
final
child Widget
The widget that the confetti will be drawn over.
final
colors List<Color>
The colors to randomly apply to the confetti particles.
final
duration Duration
The duration of the entire explosion animation before particles disappear.
final
fullScreen bool
Whether the explosion should break out of its container and explode globally across the entire screen.
final
gravity double
The downward gravity force applied to particles.
final
hashCode int
The hash code for this object.
no setterinherited
isShooting bool
Trigger to start the confetti explosion. When toggled from false to true, the confetti will explode from the center.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
particleCount int
The number of confetti particles to generate per explosion.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<AppConfetti>
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, int wrapWidth = 65}) 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