getAnimations method

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

Generates per-character bounce animations using a sine wave.

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 bounce = sin(curved * pi * bounceCount);
    final dy = -height * bounce.abs();
    return CharacterAnimation(
      translation: Offset(0, dy),
    );
  });
}