Introducing animations
In Flutter, animations are widely supported, and the framework provides multiple ways of animating widgets. Additionally, there are built-in ready-to-use animations that we only need to plug into widgets to make them animate. Though Flutter abstracts many of the complexities that animations involve, there are some important concepts we need to understand before diving into the subject of animations.
The Animation<T> class
In Flutter, animations consist of a status and a value of type T
, where the T
type is defined on the creation of the Animation
classes. The animation status corresponds to the animation state (that is, whether it's running or completed); its value changes while the animation runs, and it is this value that is intended to drive any widget changes during the animation execution.
Besides holding the information about the animation, this class also exposes callbacks, so other classes can know the animation's current status...