connections/effects/effects library

Connection effects for animations and visual enhancements.

This library provides a collection of built-in effects that can be applied to connections in a node flow diagram.

Available Effects

Usage Example

import 'package:vyuh_node_flow/vyuh_node_flow.dart';

// Use pre-configured effects
connection.animationEffect = ConnectionEffects.flowingDashFast;
connection.animationEffect = ConnectionEffects.particlesRocket;
connection.animationEffect = ConnectionEffects.pulseStrong;

// Or create custom effect instances
connection.animationEffect = FlowingDashEffect(
  speed: 2,
  dashLength: 10,
  gapLength: 5,
);

connection.animationEffect = ParticleEffect(
  particlePainter: Particles.arrow,
  particleCount: 5,
  speed: 2,
);

connection.animationEffect = GradientFlowEffect(
  colors: [Colors.blue, Colors.cyan, Colors.blue],
  speed: 1,
);

connection.animationEffect = PulseEffect(
  speed: 1,
  minOpacity: 0.3,
  maxOpacity: 1.0,
  widthVariation: 1.5,
);

Custom Effects

You can create custom effects by implementing ConnectionEffect:

class MyCustomEffect implements ConnectionEffect {
  @override
  void paint(Canvas canvas, Path path, Paint basePaint, double animationValue) {
    // Your custom effect rendering logic
  }
}

Classes

ArrowParticle
An arrow-shaped particle painter.
CharacterParticle
A character/emoji particle painter.
CircleParticle
A circular particle painter.
ConnectionEffect
Abstract interface for connection animation effects.
ConnectionEffects
Built-in connection animation effects
FlowingDashEffect
An animation effect that creates a flowing dash pattern along the connection.
GradientFlowEffect
An animation effect that creates a flowing gradient along the connection.
ParticleEffect
An animation effect that shows particles moving along the connection path.
ParticlePainter
Abstract interface for rendering particles in a ParticleEffect.
Particles
Built-in particle painters
PulseEffect
An animation effect that creates a pulsing/glowing effect on the connection.

Extensions

ConnectionEffectExtension on ConnectionEffect
Extension to add convenience methods to connection animation effect instances
ParticlePainterExtension on ParticlePainter
Extension to add convenience methods to particle painter instances