Implicit Animations in Flutter

Google Flutter 10 min min read Updated: Nov 16, 2026 Intermediate
Implicit Animations in Flutter
Intermediate Topic 1 of 7

Animations Made Easy

Animations make an app feel alive. Flutter has two families: implicit (easy, automatic) and explicit (full control). Start with implicit ones. You only change a value, and Flutter animates from the old value to the new value for you.

AnimatedContainer

dart class BoxDemo extends StatefulWidget { const BoxDemo({super.key}); @override State<BoxDemo> createState() => _BoxDemoState(); } class _BoxDemoState extends State<BoxDemo> { bool big = false; @override Widget build(BuildContext context) { return Column( mainAxisAlignment: MainAxisAlignment.center, children: [ AnimatedContainer( duration: const Duration(milliseconds: 500), curve: Curves.easeInOut, width: big ? 220 : 100, height: big ? 220 : 100, decoration: BoxDecoration( color: big ? Colors.orange : Colors.blue, borderRadius: BorderRadius.circular(big ? 60 : 12), ), ), const SizedBox(height: 24), FilledButton( onPressed: () => setState(() => big = !big), child: const Text('Animate'), ), ], ); } }

When you press the button, setState changes big. The container animates its size, color and corners smoothly over half a second.

Other Ready-Made Implicit Widgets

WidgetAnimates
AnimatedOpacityFade in and out
AnimatedAlign / AnimatedPositionedPosition changes
AnimatedPaddingPadding changes
AnimatedScale / AnimatedRotation / AnimatedSlideSize, turn and move
AnimatedDefaultTextStyleText style changes
AnimatedSwitcherSwitching between two different child widgets
AnimatedCrossFadeCross-fade between two widgets
dart AnimatedOpacity( opacity: visible ? 1.0 : 0.0, duration: const Duration(milliseconds: 300), child: const Text('Hello'), )

AnimatedSwitcher for Changing Content

dart AnimatedSwitcher( duration: const Duration(milliseconds: 300), transitionBuilder: (child, animation) => ScaleTransition(scale: animation, child: child), child: Text( '$count', key: ValueKey<int>(count), // the key tells Flutter the child changed style: const TextStyle(fontSize: 48), ), )
Why a key? AnimatedSwitcher animates only when the child's key or type changes. Without a different key, the new Text looks like the same widget and nothing animates.

TweenAnimationBuilder: Custom Values

dart TweenAnimationBuilder<double>( tween: Tween(begin: 0, end: 1), duration: const Duration(seconds: 2), builder: (context, value, child) { return Opacity( opacity: value, child: Transform.scale(scale: 0.5 + value * 0.5, child: child), ); }, child: const FlutterLogo(size: 100), )

Curves

CurveFeel
Curves.linearConstant speed, robotic
Curves.easeInOutStarts and ends slowly, natural
Curves.bounceOutBounces at the end
Curves.elasticOutSpringy
Curves.fastOutSlowInMaterial standard
Design tip: Keep animations short (150 to 400 milliseconds) and purposeful. Too much motion annoys users.

Conclusion

Implicit animations give great results with almost no code. Change a value, add a duration and a curve, and Flutter does the rest.

Quick Summary: Use AnimatedContainer and its relatives, set duration and curve, and give AnimatedSwitcher a key.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators