addGroup method Null safety

AnimationGroup addGroup(
  1. List<Animatable> animatables
)

This is a convenience method that creates an AnimatableGroup and adds it to this juggler. See AnimatableGroup for more details.

Example:

// Animate two tweens in parallel and report when complete.
var tween1 = new Tween(sprite, 3.0)..animate.x.to(700);
var tween2 = new Tween(sprite, 2.0)..animate.y.to(500)
var animationGroup = juggler.addGroup([tween1, tween2]);
animationGroup.onComplete = () => print("complete");

Implementation

AnimationGroup addGroup(List<Animatable> animatables) {
  final animationGroup = AnimationGroup();
  for (var i = 0; i < animatables.length; i++) {
    animationGroup.add(animatables[i]);
  }
  add(animationGroup);
  return animationGroup;
}