PulseEffect constructor

PulseEffect({
  1. int speed = 1,
  2. double minOpacity = 0.4,
  3. double maxOpacity = 1.0,
  4. double widthVariation = 1.0,
})

Creates a pulse animation effect.

Parameters:

  • speed: Number of complete pulse cycles per animation period. Default: 1
  • minOpacity: Minimum opacity during pulse cycle. Default: 0.4
  • maxOpacity: Maximum opacity during pulse cycle. Default: 1.0
  • widthVariation: Width multiplier at peak of pulse (1.0 = no variation). Default: 1.0

Implementation

PulseEffect({
  this.speed = 1,
  this.minOpacity = 0.4,
  this.maxOpacity = 1.0,
  this.widthVariation = 1.0,
}) : assert(speed > 0, 'Speed must be positive'),
     assert(
       minOpacity >= 0 && minOpacity <= 1,
       'Min opacity must be between 0 and 1',
     ),
     assert(
       maxOpacity >= 0 && maxOpacity <= 1,
       'Max opacity must be between 0 and 1',
     ),
     assert(minOpacity <= maxOpacity, 'Min opacity must be <= max opacity'),
     assert(widthVariation >= 1.0, 'Width variation must be >= 1.0');