You can use transition widgets to create animations in an easier way than using traditional animations. The Flutter framework contains several pre-made transitions that make animating objects extremely straightforward. These include the following:
- DecoratedBoxTransition
- FadeTransition
- PositionedTransition
- RotationTransition
- ScaleTransition
- SizeTransition
- SlideTransition
In this recipe, you will use the FadeTransition widget, but the same animation rules that you will see for FadeTransition apply to the other transitions in the Flutter framework.
In particular, you will make a square appear slowly on the screen, over a specified duration of time: