setup method

void setup({
  1. required Color color,
  2. required AnimationController controller,
  3. Curve curve = Curves.easeInOut,
  4. Color? initialColor,
  5. ChartColorAnimation? oldAnimation,
})

Initialize animation.

Implementation

void setup({
  required Color color,
  required AnimationController controller,
  Curve curve = Curves.easeInOut,
  Color? initialColor,
  ChartColorAnimation? oldAnimation,
}) {
  final Animation<Color?> animation = ColorTween(
    begin: oldAnimation?._lastColor ?? initialColor ?? Colors.transparent,
    end: color,
  ).animate(
    CurvedAnimation(
      parent: controller,
      curve: curve,
    ),
  );
  _animation = animation;
}