animateToColor method

  1. @override
void animateToColor(
  1. Color color, {
  2. Duration duration = const Duration(milliseconds: 500),
  3. Curve curve = Curves.decelerate,
})
override

Implementation

@override
void animateToColor(
  Color color, {
  Duration duration = const Duration(milliseconds: 500),
  Curve curve = Curves.decelerate,
}) {
  _tween = ColorTween(
    begin: this.color ?? const Color(0x00000000),
    end: color,
  );

  generateValues(
    duration,
    onChange: (value) {
      this.color = _tween?.transform(value);
    },
    onFinish: () {
      this.color = color;
    },
    curve: curve,
  );
}