ConfettiCustomization class
Optional overrides for particle count, colors, shape mix, physics, and directional cone (burstDirectionDegrees) for applicable presets.
Pass to ConfettiWidget or ConfettiEngine.celebrate. Unspecified fields keep each preset’s factory defaults.
- Annotations
Constructors
-
ConfettiCustomization({int? particleCount, List<
Color> ? colors, List<ParticleShape> ? shapeMix, double? gravity, double speedMultiplier = 1.0, double lifetimeMultiplier = 1.0, double? burstDirectionDegrees, double? burstSpreadDegrees, bool useTickBasedPhysics = false, TickConfettiSpawnOptions? tickSpawnOptions, BlendMode? particleBlendMode}) -
Creates customization overrides.
const
Properties
- burstDirectionDegrees → double?
-
Directional burst / fountain cone — degrees where
0= east (right),90= south (down),-90= north (up). When null, Preset.nova uses a full 360° spray (typical “up” aim uses-90).final - burstSpreadDegrees → double?
-
Half-width of the cone in degrees when burstDirectionDegrees is set.
Clamped between
5and180when applied. Defaults to90if null.final -
colors
→ List<
Color> ? -
Replaces the preset’s color palette when non-null and non-empty.
final
- gravity → double?
-
Overrides downward acceleration in pixels per second squared.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- lifetimeMultiplier → double
-
Scales each particle’s lifespan (
maxLifetime).final - particleBlendMode → BlendMode?
-
Blend mode for particle fills/strokes (additive / screen effects).
final
- particleCount → int?
-
Total particles to spawn for the run. Clamped to
[minParticleCount, maxParticleCount].
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shapeMix
→ List<
ParticleShape> ? -
Replaces which ParticleShapes are randomly chosen when non-null and
non-empty. Include ParticleShape.emoji if you want unicode particles
(still driven by
emojiPoolon the widget / engine).final - speedMultiplier → double
-
Scales initial velocity components (
vx,vy) at spawn time.final - tickSpawnOptions → TickConfettiSpawnOptions?
-
Overrides preset tick defaults when useTickBasedPhysics is true (full option set).
final
- useTickBasedPhysics → bool
-
When true, presets use tick physics and shaped draws (star / oval circle /
skew quad square / triangle).
final
Methods
-
copyWith(
{int? particleCount, List< Color> ? colors, List<ParticleShape> ? shapeMix, double? gravity, double? speedMultiplier, double? lifetimeMultiplier, double? burstDirectionDegrees, double? burstSpreadDegrees, bool? useTickBasedPhysics, TickConfettiSpawnOptions? tickSpawnOptions, BlendMode? particleBlendMode}) → ConfettiCustomization - Returns a copy with the given fields replaced.
-
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
Static Methods
-
effectiveCount(
int presetDefault, ConfettiCustomization? c) → int - Effective particle count for a preset default when particleCount is set.
-
effectiveGravity(
double presetGravity, ConfettiCustomization? c) → double - Effective gravity: optional customization overrides the preset when finite.
-
effectiveLifetimeMultiplier(
ConfettiCustomization? c) → double - Effective lifetime multiplier after clamping.
-
effectiveParticleBlendMode(
ConfettiCustomization? c) → BlendMode? - Effective blend mode for vector particle draws; null means default compositing.
-
effectiveSpeedMultiplier(
ConfettiCustomization? c) → double - Effective speed multiplier after clamping.
-
merge(
ConfettiCustomization? base, ConfettiCustomization? override) → ConfettiCustomization? -
Merges
basewithoverride; non-null fields onoverridewin.
Constants
- maxParticleCount → const int
- Maximum allowed particleCount (inclusive).
- minParticleCount → const int
- Minimum allowed particleCount (inclusive).