show method
Animate a list of widgets with a default slide and fade animation.
delayis the delay before the first animation starts.incrementis the delay between each animation.durationis the duration of the animation.curveis the curve of the animation.beginis the starting position of the animation.endis the ending position of the animation.limitis the maximum number of widgets to animate (0 for all).
Implementation
List<Widget> show({
Duration delay = Duration.zero,
Duration increment = const Duration(milliseconds: 100),
Duration duration = const Duration(seconds: 1, milliseconds: 500),
Curve? curve,
double begin = 2,
double end = 0,
int limit = 8,
}) {
assert(limit >= 0, 'Limit must be positive');
curve ??= Sprung.custom(damping: 19);
var animated = 0;
final widgets = <Widget>[];
for (var i = 0; i < length; i++) {
// Don't animate spacer widgets
if (this[i] is SizedBox && (this[i] as SizedBox).child == null) {
widgets.add(this[i]);
continue;
}
if (limit > 0 && animated >= limit) {
widgets.add(this[i]);
continue;
}
widgets.add(
this[i]
.animate()
.slideY(
begin: begin,
end: end,
curve: curve,
duration: duration,
delay: delay + increment * i,
)
.fadeIn(
curve: curve,
duration: duration,
delay: delay + increment * i,
),
);
animated++;
}
return widgets;
}