getAnimations method

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

Generates per-character scale following a traveling sine wave.

Implementation

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

  final curved = applyCurve(progress);

  return List.generate(charCount, (index) {
    final phase = 2 * pi * waveCount * (index / charCount);
    final oscillation = sin(curved * 2 * pi - phase);
    final normalized = (oscillation + 1) / 2;
    final scale = scaleMin + (scaleMax - scaleMin) * normalized;
    return CharacterAnimation(scale: scale);
  });
}