AnimateList<T extends Widget> constructor

AnimateList<T extends Widget>({
  1. required List<Widget> children,
  2. List<Effect>? effects,
  3. Duration? interval,
  4. AnimateCallback? onPlay,
  5. AnimateCallback? onComplete,
  6. 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);
}