Designing animations part 2 — Adding multiple animations
We will now wire up a series of tweens that describe what values the animation is supposed to change and then link the tweens to the AnimationController
. This will allow us to move the ball on the screen at different speeds.
In this recipe, you will learn how to perform several animations with the same AnimationController
, which will give you the flexibility to perform more interesting custom animations in your app.
Getting ready
To follow along in this recipe, you need the app built in the previous recipe, Designing animations part 1 — VSync and the AnimationController.
How to do it…
In the next few steps, you will see how to perform two Tween
animations at the same time using a single AnimationController
:
- At the top of the
_ShapeAnimationState
class, remove thepos
double, and add two new values, one for the top position and one for the left position of the ball. Also,...