setup method

void setup({
  1. required AnimationController controller,
  2. required TextStyle textStyle,
  3. Curve curve = Curves.easeOutExpo,
  4. TextStyle? initialTextSyle,
  5. ChartTextStyleAnimation? oldAnimation,
})

Initialize animation.

Implementation

void setup({
  required AnimationController controller,
  required TextStyle textStyle,
  Curve curve = Curves.easeOutExpo,
  TextStyle? initialTextSyle,
  ChartTextStyleAnimation? oldAnimation,
}) {
  final Animation<TextStyle> animation = TextStyleTween(
    begin: oldAnimation?._lastTextStyle ??
        initialTextSyle ??
        const TextStyle(
          color: Colors.transparent,
        ),
    end: textStyle,
  ).animate(
    CurvedAnimation(
      parent: controller,
      curve: curve,
    ),
  );
  _animation = animation;
}