GradientFlowEffect constructor

GradientFlowEffect({
  1. List<Color>? colors,
  2. int speed = 1,
  3. double gradientLength = 0.25,
  4. double connectionOpacity = 1.0,
})

Creates a gradient flow animation effect.

Parameters:

  • colors: List of colors for the gradient. Default: null (uses connection color)
  • speed: Number of complete cycles per animation period. Default: 1
  • gradientLength: Length of the gradient. If < 1, treated as percentage (0.25 = 25% of path). If >= 1, treated as absolute pixels. Default: 0.25 (25%)
  • connectionOpacity: Opacity of the base connection (0.0-1.0). Default: 1.0 (no fading)

Implementation

GradientFlowEffect({
  this.colors,
  this.speed = 1,
  this.gradientLength = 0.25,
  this.connectionOpacity = 1.0,
}) : assert(speed > 0, 'Speed must be positive'),
     assert(gradientLength > 0, 'Gradient length must be positive'),
     assert(
       connectionOpacity >= 0 && connectionOpacity <= 1.0,
       'Connection opacity must be between 0 and 1',
     ),
     assert(
       colors == null || colors.length >= 2,
       'Colors list must contain at least 2 colors',
     );