ConfettiParticle class
One confetti piece's fixed randomized traits, generated once at spawn.
Motion at any time t is a pure function of these traits (see
confettiOffsetAt/confettiRotationAt/confettiOpacityAt) so the
simulation is deterministic and unit-testable without building a widget.
- Annotations
Constructors
- ConfettiParticle({required double startX, required double fallSpeed, required double size, required double startRotation, required double rotationSpeed, required double swayAmplitude, required double swayFrequency, required Color color, ConfettiShape shape = ConfettiShape.rect})
-
const
Properties
- color → Color
-
final
- fallSpeed → double
-
Downward speed in logical px/sec.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- rotationSpeed → double
-
Spin speed in radians/sec.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shape → ConfettiShape
-
Rect or circle — mixed randomly per particle by
generateConfettiParticles so a burst isn't visually uniform.
final
- size → double
-
final
- startRotation → double
-
Starting rotation in radians.
final
- startX → double
-
Horizontal spawn position, 0.0 (left edge) - 1.0 (right edge).
final
- swayAmplitude → double
-
Side-to-side sway amplitude in logical px.
final
- swayFrequency → double
-
Sway speed (radians/sec) fed into a sine wave.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited