📱 Flutter Intermediate

What is AnimationController in Flutter and how do you use it?

Answer

AnimationController generates a sequence of values from 0.0 to 1.0 over a specified duration. It requires a vsync parameter (the State class mixed with TickerProviderStateMixin) to tie animations to the screen's 60fps refresh rate, preventing off-screen animations from consuming CPU. Control playback with .forward(), .reverse(), .stop(), and .repeat(). Combine it with a Tween and an AnimatedBuilder or AnimatedWidget to drive actual UI changes.