DotAnimationConfig.forIndex constructor
DotAnimationConfig.forIndex({})
Creates a config for a dot based on its index and total dot count.
Implementation
factory DotAnimationConfig.forIndex({
required int index,
required int dotCount,
required double baseSize,
required bool isEven,
}) {
final step = 0.09; // Interval step for staggering animations
final start = index * step;
return DotAnimationConfig(
heightInterval: Interval(start, start + step),
offsetInterval: Interval(start + step, start + 2 * step),
reverseHeightInterval: Interval(start + 2 * step, start + 3 * step),
reverseOffsetInterval: Interval(start + 3 * step, start + 4 * step),
maxHeight: isEven ? baseSize * 0.7 : baseSize * 0.4,
maxOffset: -(baseSize * 0.20),
);
}