Flutter & Dart (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What are `const` constructors and why are they critical for Flutter performance?
junior LevelFormsPerformance
In Simple Words:
When a widget constructor is marked const (const Text("Hello")):
- Flutter creates a single canonical instance in memory at compile-time.
- When the parent widget rebuilds, Flutter knows with 100% certainty that the
constwidget has not changed, and skips rebuilding it and its entire subtree! - Using
constaggressively eliminates redundant widget builds and maximizes frame rate.