AnimateList<T extends Widget> constructor
AnimateList<T extends Widget> ({
- required List<
Widget> children, - List<
Effect> ? effects, - Duration? interval,
- AnimateCallback? onPlay,
- AnimateCallback? onComplete,
- Adapter? adapter,
Creates an AnimateList instance that will wrap all children in an Animate instance, and proxy any added effects to each of them.
Implementation
AnimateList({
required List<Widget> children,
List<Effect>? effects,
Duration? interval,
AnimateCallback? onPlay,
AnimateCallback? onComplete,
Adapter? adapter,
}) {
// build new list, wrapping each child in Animate
for (int i = 0; i < children.length; i++) {
Widget child = children[i];
Type type = child.runtimeType;
if (!ignoreTypes.contains(type)) {
child = Animate(
delay: (interval ?? Duration.zero) * i,
onPlay: onPlay,
onComplete: onComplete,
adapter: adapter,
child: child,
);
_managers.add(child as Animate);
}
_widgets.add(child);
}
if (effects != null) addEffects(effects);
}