ColorEffect constructor

ColorEffect(
  1. Color color,
  2. EffectController controller, {
  3. double opacityFrom = 0,
  4. double opacityTo = 1,
  5. String? paintId,
  6. void onComplete()?,
  7. ComponentKey? key,
})

Implementation

ColorEffect(
  this.color,
  EffectController controller, {
  double opacityFrom = 0,
  double opacityTo = 1,
  this.paintId,
  void Function()? onComplete,
  super.key,
})  : assert(
        opacityFrom >= 0 &&
            opacityFrom <= 1 &&
            opacityTo >= 0 &&
            opacityTo <= 1,
        'Opacity value should be between 0 and 1',
      ),
      _tween = Tween(begin: opacityFrom, end: opacityTo),
      super(controller, onComplete: onComplete);