ParticleEffect class

An animation effect that shows particles moving along the connection path.

Creates a visual flow effect where multiple particles travel along the connection, useful for showing data flow or direction. Particles can be customized using different ParticlePainter implementations.

Example:

// Circle particles
connection.animationEffect = ParticleEffect(
  particlePainter: CircleParticle(radius: 4.0),
  particleCount: 5,
  speed: 2,
);

// Arrow particles
connection.animationEffect = ParticleEffect(
  particlePainter: ArrowParticle(length: 12.0),
  particleCount: 3,
  speed: 1,
);

// Emoji particles
connection.animationEffect = ParticleEffect(
  particlePainter: CharacterParticle(character: '🚀', fontSize: 16.0),
  particleCount: 3,
  speed: 1,
);
Implemented types
Available extensions

Constructors

ParticleEffect({ParticlePainter? particlePainter, int particleCount = 3, int speed = 1, double connectionOpacity = 0.3})
Creates a particle animation effect.

Properties

connectionOpacity → double
Opacity of the base connection underneath particles (0.0 to 1.0) 0.0 = invisible, 1.0 = full opacity
final
hashCode → int
The hash code for this object.
no setterinherited
isBuiltIn → bool

Available on ConnectionEffect, provided by the ConnectionEffectExtension extension

Check if this is a built-in connection effect
no setter
particleCount → int
Number of particles traveling along the path
final
particlePainter → ParticlePainter
The painter used to render each particle
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
speed → int
Number of complete cycles per animation period (integer for seamless looping)
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint(Canvas canvas, Path path, Paint basePaint, double animationValue) → void
Paints the animated connection effect on the canvas.
override
toString() → String
A string representation of this object.
inherited

Operators

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