Particle class abstract

Base class implementing common behavior for all the particles.

Intention is to follow the same "Extreme Composability" style as seen across the whole Flutter framework. Each type of particle implements some particular behavior which then could be nested and combined to create the experience you are looking for.

Implementers

Constructors

Particle({double? lifespan})
Construct a new Particle.

Properties

hashCode int
The hash code for this object.
no setterinherited
lifespan double
Getter for the current lifespan of this Particle.
no setter
progress double
Getter which should be used by subclasses to get overall progress.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldRemove bool
This method will return true as soon as the particle reaches the end of its lifespan.
no setter

Methods

accelerated({required Vector2 acceleration, Vector2? position, Vector2? speed}) Particle
Wraps this particle with a AcceleratedParticle.
moving({required Vector2 to, Vector2? from, Curve curve = Curves.linear}) Particle
Wraps this particle with a MovingParticle.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
render(Canvas canvas) → void
Should render this Particle to given Canvas.
rotated(double angle) Particle
Rotates this particle to a fixed angle in radians using the RotatingParticle.
rotating({double from = 0, double to = pi}) Particle
Rotates this particle from a given angle to another one in radians using RotatingParticle.
scaled(double scale) Particle
Wraps this particle with a ScaledParticle.
scaling({double to = 0, Curve curve = Curves.linear}) ScalingParticle
Wraps this particle with a ScalingParticle.
setLifespan(double lifespan) → void
A control method allowing a parent of this Particle to pass down it's lifespan.
toString() String
A string representation of this object.
inherited
translated(Vector2 offset) Particle
Wraps this particle with a TranslatedParticle.
update(double dt) → void
Updates the _timer of this Particle.

Operators

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

Static Methods

generate({required ParticleGenerator generator, int count = 10, double? lifespan, bool applyLifespanToChildren = true}) Particle
Generates a given amount of particles and then combining them into one single ComposedParticle.