Particle class

The Particle class represents a single particle in the animation.

The Particle class holds information about the particle's configuration, position, size, and appearance. It is responsible for drawing the particle on the canvas using the provided configuration and applying any transformations specified by the rotation.

Constructors

Particle({required ParticleConfiguration configuration, required Offset position, double rotation = 0})
Creates a Particle with the specified configuration and position.

Properties

color Color
The current color of the particle
no setter
hashCode int
The hash code for this object.
no setterinherited
initialColor ParticleColor
The initial color of the particle as defined in its configuration.
final
initialPosition Offset
The initial position of the particle when it was created.
final
initialSize Size
The initial size of the particle as defined in its configuration.
final
position Offset
The current position of the particle relative to the top left of the canvas.
getter/setter pair
postEffectBuilder PostEffectBuilder?
Effect to trigger once particle travel is over.
final
rotation double
The rotation in degrees of the particle
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape Shape
The shape of the particle as defined in its configuration.
latefinal
size Size
The current size of the particle.
getter/setter pair
zIndex int
The z-index of the particle, used during painting to determine the order in which particles are rendered.
no setter

Methods

computeTransformation(Image defaultShapes) → ({BlendMode? blendMode, Color color, Image image, Rect rect, RSTransform transform})?
Computes the transformation for rendering the image using the particle state.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
updateColor(double progress) → void
Update the color of the particle.
updateOpacity(double opacity) → void
Update the opacity of the particle.

Operators

operator ==(Object other) bool
The equality operator.
inherited