📱 Flutter Intermediate

What is AnimationController in Flutter?

Why Interviewers Ask This

Mid-level Flutter roles require deep understanding of this topic. Interviewers ask this to separate candidates who truly understand the mechanics from those who only know surface-level concepts.

Answer

AnimationController is the core class that drives animations in Flutter. It generates values between 0.0 and 1.0 over a specified duration and requires a vsync parameter (usually the State class implementing TickerProviderStateMixin) to synchronize with the screen refresh rate. Use .forward() to play forward, .reverse() to play backward, and .repeat() to loop. Always call controller.dispose() in the widget's dispose() method.

Pro Tip

This topic has Flutter-specific nuances that differ from general programming. Highlighting those nuances in your answer shows expertise rather than generic knowledge.