Particle class abstract
Single Particle Model
Constructors
-
Particle({required Color color, required Offset velocity, double rotationSpeed = 0, double? lifetime, Color? endColor, List<
Color> ? colorGradient, Curve colorCurve = const Cubic(0, 0, 1, 1), double startScale = 1.0, double? endScale, Curve scaleCurve = const Cubic(0, 0, 1, 1), double startOpacity = 1.0, double? endOpacity, Curve opacityCurve = const Cubic(0, 0, 1, 1), bool trailEnabled = false, int trailLength = 10, bool trailFade = true})
Properties
- age → double
-
no setter
- color → Color
-
Define the color of a single particle.
final
- colorCurve → Curve
-
final
-
colorGradient
→ List<
Color> ? -
final
- currentVelocity → Offset
-
no setter
- endColor → Color?
-
final
- endOpacity → double?
-
final
- endScale → double?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isExpired → bool
-
no setter
- lifetime → double?
-
Duration in seconds before the particle expires. null = infinite.
final
- lifetimeProgress → double
-
no setter
- opacityCurve → Curve
-
final
- paintColor → Color
-
no setter
- position → Offset
-
no setter
- rotation → double
-
no setter
- rotationSpeed → double
-
Define the rotation speed of a single particle.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleCurve → Curve
-
final
- startOpacity → double
-
final
- startScale → double
-
final
- trailCount → int
-
no setter
- trailEnabled → bool
-
final
- trailFade → bool
-
final
- trailLength → int
-
final
- updateAge ← double
-
no getter
- updateCurrentColor ← Color
-
no getter
- updateCurrentOpacity ← double
-
no getter
- updateCurrentScale ← double
-
no getter
- updatePosition ← Offset
-
no getter
- updateRotation ← double
-
no getter
- updateVelocity ← Offset
-
no getter
- velocity → Offset
-
Define the direction and speed of a single particle.
final
Methods
-
drawParticle(
Canvas canvas, Size size) → void - Allow subclasses to define their own draw method
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paint(
Canvas canvas, Size size) → void -
pushTrailPosition(
Offset pos) → void -
resetLifetimeState(
) → void - Resets lifetime-driven runtime state (color/scale/opacity/trail) back to start values. Used when a pooled particle slot is reused for a new burst.
-
rotate(
Canvas canvas, double cx, double cy) → void -
toString(
) → String -
A string representation of this object.
inherited
-
trailPositionAt(
int i) → Offset
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited