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
configuration ParticleConfiguration
The configuration of the particle, defining its shape, size, and color.
final
hashCode int
The hash code for this object.
no setterinherited
initialPosition Offset
The initial position of the particle when it was created.
final
initialSize Size
Gets the initial size of the particle as defined in its configuration.
no setter
position Offset
The current position of the particle.
getter/setter pair
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
size Size
The current size of the particle.
getter/setter pair

Methods

computeTransformation(Image defaultShapes) → (Image, Rect, RSTransform, Color)
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) → dynamic
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