Simplifying with Animated­Widget

What's the point?

How to use the AnimatedWidget helper class
(instead of addListener()
and setState()) to create a widget that animates.

Use AnimatedWidget to create a widget that performs
a reusable animation.
To separate the transition from the widget, use an
AnimatedBuilder, as shown in the
Refactoring with AnimatedBuilder section.

Examples of AnimatedWidgets in the Flutter API:
AnimatedBuilder, AnimatedModalBarrier,
DecoratedBoxTransition, FadeTransition,
PositionedTransition, RelativePositionedTransition,
RotationTransition, ScaleTransition,
SizeTransition, SlideTransition.

The AnimatedWidget base class allows you to separate out
the core widget code from the animation code.
AnimatedWidget doesn’t need to maintain a State
object to hold the animation. Add the following AnimatedLogo class: