cascadeIntervals static method

List<Interval> cascadeIntervals(
  1. int itemCount, {
  2. double staggerAmount = 0.1,
  3. Curve curve = Curves.easeOutCubic,
})

Creates a cascading stagger effect configuration.

Implementation

static List<Interval> cascadeIntervals(
  int itemCount, {
  double staggerAmount = 0.1,
  Curve curve = Curves.easeOutCubic,
}) {
  return List.generate(itemCount, (index) {
    final start = (index * staggerAmount).clamp(0.0, 0.9);
    final end = (start + (1.0 - start)).clamp(start, 1.0);
    return Interval(start, end, curve: curve);
  });
}