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 pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Flutter interview questions

View all →