Designing animations part 1 — Using the AnimationController
In this recipe, you will perform the first step of making your widgets animatable, by conforming to a ticker Mixin and initializing an AnimationController. You will also add the appropriate listeners to make sure the build function reruns at every tick.
You will build an animation that moves a ball diagonally starting from the top of the screen, then stopping at an ending position as shown in Figure 12.2:

Figure 12.2: Example of AnimationController
Getting ready
To follow along with this recipe, you can create a new Flutter project, or you can use the app created in the previous recipe, Creating basic container animations.
How to do it...
In this recipe, you will build a widget that moves across the screen:
- In the
libfolder, create a new file calledshape_animation.dart. - At the top of the file, import
material.dart:import 'package:flutter/material.dart&apos...