seniorFlutter
Explain the difference between `const` and `final` and their impact on rebuilds.
Updated Apr 28, 2026
Short answer
final means a variable is assigned once at runtime. const means the variable is a compile-time constant.
Deep explanation
In Flutter, using const constructors tells the framework that the widget's properties will never change. During the build phase, Flutter skips re-evaluating and rebuilding const widgets entirely if their parent rebuilds. This is one of the most critical performance optimizations.
Unlock with a Pro subscription to view this section.
View pricingReal-world example
No real-world example available yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProCommon mistakes
No common mistakes listed yet.
Unlock with a Pro subscription to view this section.
Upgrade to ProFollow-up questions
No follow-up questions available yet.
Unlock with a Pro subscription to view this section.
Upgrade to Pro