getAnimations method

  1. @override
List<CharacterAnimation> getAnimations(
  1. double progress,
  2. int charCount
)
override

Generates per-character rotation with simultaneous scale-in.

Implementation

@override
List<CharacterAnimation> getAnimations(double progress, int charCount) {
  if (charCount == 0) return [];

  return List.generate(charCount, (index) {
    final staggered = staggeredProgress(progress, index, charCount);
    final curved = applyCurve(staggered);

    final angle = (curved * 2 * pi * spinCount) % (2 * pi);
    final scale = scaleFrom + (1.0 - scaleFrom) * curved;

    return CharacterAnimation(
      rotation: angle,
      scale: scale,
    );
  });
}