📱 Flutter Intermediate

What is AnimatedContainer in Flutter?

Answer

AnimatedContainer is the simplest way to create animations in Flutter. It is identical to a regular Container but automatically animates any property change (width, height, color, padding, alignment, decoration) over a given duration. Just call setState() to change any property and the animation happens automatically — no AnimationController needed. Use it for interactive elements that need to change size, color, or shape in response to user actions, like toggle switches or expanding cards.