Why are const constructors important for Flutter performance?

Why Interviewers Ask This

This is a differentiating question used for senior and lead roles. Interviewers want to see if you can explain not just what happens, but why — and what the trade-offs are in different approaches.

Answer

When you use const constructors, Dart creates the widget object at compile time and canonicalizes it — meaning the same const widget with the same arguments is the exact same object in memory. Flutter's reconciliation algorithm can then detect that a const widget has not changed and skip rebuilding its entire subtree. This is a significant optimization in large widget trees where a parent setState() would otherwise force all child widgets to rebuild unnecessarily. Always use const for widgets that never change: const Text("Hello"), const SizedBox(height: 16).

Pro Tip

Before answering, structure your response: one-line definition → real-world analogy → concrete example from a project. This makes even complex Flutter answers easy to follow.