📱 Flutter Intermediate

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

Why Interviewers Ask This

Candidates at the intermediate level are expected to not only know this concept but explain the trade-offs involved. Interviewers use this question to see if you can reason about design decisions, not just recall facts.

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.

Pro Tip

Demonstrate both theoretical understanding and practical experience. Say what it is, then give an example of how you actually used it in a Flutter codebase.