Explain Flutter's 'constraints down, sizes up' rule and unbounded height error
WHAT IT TESTS: Flutter's constraint protocol. ANSWER OUTLINE: Parents constrain down, children size up. ListView in Column throws unbounded height as Column gives infinite maxHeight; fix with Expanded or shrinkWrap.
WHAT IT TESTS: Mastery of Flutter's box constraint negotiation where parents impose bounds and children resolve size within them. ANSWER OUTLINE: First, describe two-pass algorithm: constraints flow down, sizes flow up. Second, show concrete failure: a ListView inside a Column throws unbounded height because Column passes infinite maxHeight and ListView tries to fill it. Third, explain fixes: wrap ListView in Expanded for bounded flex space, or use shrinkWrap so it only occupies its children's height.
Read the original → docs.flutter.dev
- #flutter
- #layout
- #constraints
- #interview
- #widgets
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.