animate method

Gradient animate({
  1. required Animation<double> controller,
  2. Map<GradientAnimation, dynamic> storyboard = const {},
  3. GradientCopyWith overrideCopyWith = spectrumCopyWith,
})

Returns the AnimatedGradient.observe animated Gradient output from a new AnimatedGradient constructed by this Gradient and the provided parameters.

Provide a Tween<double>().animate() or an AnimationController as controller to drive the flow of the animation. Consider driving the AnimationController by controller.repeat(reverse:true).

The default style is GradientAnimation.colorArithmetic, which looks to parameter colorShading for the function to invoke.

The default colorShading is Shades.withOpacity which applies the clamped animation value as each gradient color's opacity, between 0..1.

If style == GradientAnimation.stopsArithmetic, then function stopsArithmetic applies the animation transformation. Default is Maths.subtraction.

Implementation

Gradient animate({
  required Animation<double> controller,
  // GradientStoryboard storyboard = AnimatedGradient.defaultStoryboard,
  Map<GradientAnimation, dynamic> storyboard = const {},
  GradientCopyWith overrideCopyWith = spectrumCopyWith,
}) =>
    AnimatedGradient(
      gradient: this,
      controller: controller,
      storyboard: storyboard,
      // style: style,
      // colorArithmetic: colorShading,
      // stopsArithmetic: stopsArithmetic,
      // tweenSpec: tweenSpec,
      overrideCopyWith: overrideCopyWith,
    ).observe;