Flutter makes animation easy. Implicit animations animate automatically when a value changes; explicit ones give full control.
Implicit (easiest)
AnimatedContainer(
duration: Duration(milliseconds: 300),
width: expanded ? 200 : 100,
color: expanded ? Colors.blue : Colors.grey,
)
// just change `expanded` in setState — it animates
Explicit
Use an AnimationController (with a TickerProvider) for custom, repeatable animations.
Tip: Reach for AnimatedContainer, AnimatedOpacity and Hero first — they cover most needs with almost no code.
Summary
Implicit animations (AnimatedContainer, AnimatedOpacity) cover most cases; use AnimationController for advanced control.