addChain method Null safety

AnimationChain addChain(
  1. List<Animatable> animatables
)

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

Example:

// Animate two tweens sequentially 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 animationChain = juggler.addChain([tween1, tween2]);
animationChain.onComplete = () => print("complete");

Implementation

AnimationChain addChain(List<Animatable> animatables) {
  final animationChain = AnimationChain();
  for (var i = 0; i < animatables.length; i++) {
    animationChain.add(animatables[i]);
  }
  add(animationChain);
  return animationChain;
}