Simple Animations is a package for Flutter to boost your animation productivity by simplifying the way to create animations.
但是，即使是小动画也会感觉和爆炸你的代码库。 **动画是Flutter最需要的方面之一 很难掌握。
There are multiple ways to get started:
- Dive into the documentation
- Try the Example App of simple_animations
- Read articles and tutorials about using simple_animations
This custom animation seems simple but it’s rather complex:
It’s combining a staggered animation sequence with an enduring animation:
- At the beginning it animates the height of a box. After that it increases the width.
- While increasing the width a typewriter-like animated underscore appears and persists.
- Shortly before the width reaches it’s final size, it starts to type-write a text.
With traditional Flutter animation classes this will end in a huge StatefulWidget with multiple AnimationController, Tweens and all that initState and onDispose overhead.
With simple_animation you can do it stateless just by using some fancy ControlledAnimation widgets.
The whole animation just takes about 60 lines of code while maintaining readability. (You can find the source code here. I only counted the lines that are responsible for the animation.)
Pub Example Tab
This is the example from the example page (pub.dartlang.org):
You find these and other examples in Example App.