getAnimations method

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

Generates a left-to-right binary color fill per character.

Implementation

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

  final curved = applyCurve(progress);
  final fillIndex = (curved * charCount).round().clamp(0, charCount);

  return List.generate(charCount, (index) {
    return CharacterAnimation(
      color: index < fillIndex ? filledColor : emptyColor,
    );
  });
}