Quiz
Flutter track quiz: 10 questions on widgets, state, layout, navigation.
Flutter — track quiz
EXAMPLE
// 10 questions. Pass: >= 7. // ===== Q1 ===== // What is the difference between StatelessWidget and StatefulWidget? // A) StatefulWidget can rebuild based on internal state via setState // B) StatelessWidget cannot have children // C) StatefulWidget runs only in debug mode // D) None of the above // ===== Q2 ===== // What does 'const' do for widget constructors? // A) Makes them immutable at compile time + reuses the same widget instance // B) Marks them deprecated // C) Required for all widgets // D) Disables hot reload // ===== Q3 ===== // For a long lazy list, you should use: // A) Column with .map() // B) ListView.builder // C) Wrap // D) GridView.count // ===== Q4 ===== // When does setState() rebuild the widget? // A) Immediately // B) On the next frame // C) Only in release mode // D) Never // ===== Q5 ===== // To make a widget fill remaining space in a Row / Column, use: // A) Padding // B) Expanded // C) Center // D) Container with width: double.infinity // ===== Q6 ===== // What is a Key for in Flutter? // A) Identifies a widget so Flutter can preserve state across rebuilds // B) Encryption // C) Required for all widgets // D) Animation timing // ===== Q7 ===== // Which navigation package is recommended in 2026? // A) Navigator 1.0 // B) go_router or auto_route // C) WebView // D) No package — use raw routes // ===== Q8 ===== // Best for global theming + dark mode: // A) ThemeData on MaterialApp + Brightness // B) Hard-coded colours everywhere // C) inheritedWidget per screen // D) CSS files // ===== Q9 ===== // Which state-management library is recommended? // A) Provider, Riverpod, Bloc, or GetX (pick one per app) // B) setState only // C) Custom global variables // D) Singleton pattern // ===== Q10 ===== // 'flutter pub get' does: // A) Tests the app // B) Installs dependencies from pubspec.yaml // C) Builds for release // D) Generates SHA hashes // ===== Answers ===== // 1. A 2. A 3. B 4. B 5. B 6. A 7. B 8. A 9. A 10. B // ===== Patterns to internalise ===== // - const constructors everywhere they fit // - ListView.builder for lazy lists // - Expanded / Flexible for proportional sizing // - Keys for preserving state in reorderable lists // - One state lib per app // - ThemeData + Brightness for dark mode
Why it matters
Quiz takeaway: master const constructors, ListView.builder, Expanded/Flexible, Keys, ThemeData, and pick one state management library per app. The exam covers patterns that show up daily; reflex these and Flutter feels productive.
Tip: Tweak the snippet with Try it Yourself », then sit the quiz at the bottom of the page.
Discussion
Loading…