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