A. CrossAxisAlignment.stretch causes error in Row without fixed height
B. mainAxisSize.min is invalid for Row
C. Text widgets cannot be children of Row
D. Row requires only one child widget
Solution
Step 1: Analyze CrossAxisAlignment.stretch in Row
Row arranges children horizontally; stretch tries to expand children vertically to fill parent height.
Step 2: Check if Row has bounded height
Without a fixed height parent, stretch causes layout errors because height is unbounded.
Final Answer:
CrossAxisAlignment.stretch causes error in Row without fixed height -> Option A
Quick Check:
Stretch needs bounded height in Row = B [OK]
Hint: Stretch in Row needs fixed height parent to avoid errors [OK]
Common Mistakes:
Thinking mainAxisSize.min is invalid
Believing Text can't be in Row
Assuming Row accepts only one child
5. You want to arrange three buttons horizontally with equal space between them filling the screen width. Which layout widget and property combination achieves this best?
hard
A. Stack with Positioned widgets
B. Row with MainAxisAlignment.spaceBetween
C. Column with CrossAxisAlignment.stretch
D. Container with padding
Solution
Step 1: Identify horizontal arrangement
Row arranges children horizontally, suitable for buttons side by side.
Step 2: Use MainAxisAlignment.spaceBetween
This property places equal space between children, stretching them across the width.
Step 3: Evaluate other options
Column arranges vertically, Stack overlaps widgets, Container only adds padding but does not arrange children.
Final Answer:
Row with MainAxisAlignment.spaceBetween -> Option B
Quick Check:
Horizontal equal spacing = Row + spaceBetween = C [OK]
Hint: Use Row + spaceBetween for equal horizontal spacing [OK]
Common Mistakes:
Using Column for horizontal layout
Trying to position with Stack unnecessarily
Relying on Container padding for spacing
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.