D
AnimationsEasy20 XP3 min read

What is the difference between implicit and explicit animations?

TL;DR: Implicit animations (AnimatedContainer, AnimatedOpacity) automatically animate between property changes with no controller needed. Explicit animations (AnimationController + AnimatedBuilder) give full control over start, stop, loop, and custom interpolation.

Full Answer

Flutter offers two tiers of animation APIs designed for different levels of complexity.

AspectImplicitExplicit
SetupJust change a property valueAnimationController + vsync
ControlAuto-animates on rebuildForward, reverse, repeat, stop
ExamplesAnimatedContainer, AnimatedOpacity, TweenAnimationBuilderAnimationController, AnimatedBuilder, AnimatedWidget
Best forSimple property transitionsComplex, looping, or coordinated animations
๐ŸŽฏ

Start with implicit. Upgrade to explicit only when you need control beyond 'animate when value changes'.

Code Examples

dartImplicit vs Explicit comparison
Output
// Implicit: tap to expand/collapse
// Explicit: can loop, sequence, and precisely control playback

Common Mistakes

  • โœ—Using explicit animations when implicit would suffice โ€” unnecessary boilerplate
  • โœ—Forgetting the child parameter in AnimatedBuilder โ€” passes non-animated subtrees as a cache

Interview Tip

๐Ÿ’ก

The 'child' parameter in AnimatedBuilder is often overlooked in interviews. Explain that passing the non-animated subtree as child prevents it from being rebuilt on every frame.

#implicit-animation#explicit-animation#animated-container#animation-controller