0
0
Fluttermobile~5 mins

MainAxisAlignment and CrossAxisAlignment in Flutter - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does MainAxisAlignment control in a Flutter Row or Column?

MainAxisAlignment controls how the children are placed along the main axis, which is horizontal for Row and vertical for Column.

Click to reveal answer
beginner
What is the main difference between MainAxisAlignment and CrossAxisAlignment?

MainAxisAlignment aligns children along the main axis (horizontal in Row, vertical in Column), while CrossAxisAlignment aligns children along the cross axis (vertical in Row, horizontal in Column).

Click to reveal answer
intermediate
What does MainAxisAlignment.spaceBetween do?

It places the children so that the first child is at the start, the last child is at the end, and the remaining space is evenly distributed between the children.

Click to reveal answer
intermediate
How does CrossAxisAlignment.stretch affect children in a Column?

It makes the children expand to fill the maximum width available along the cross axis (horizontal axis in a Column).

Click to reveal answer
beginner
If you want to center children both horizontally and vertically in a Column, which properties would you set?

Set MainAxisAlignment.center to center vertically and CrossAxisAlignment.center to center horizontally.

Click to reveal answer
In a Row, which axis does MainAxisAlignment control?
ANeither axis
BHorizontal axis
CBoth axes
DVertical axis
What does CrossAxisAlignment.start do in a Column?
AAligns children to the left
BAligns children to the right
CAligns children to the top
DAligns children to the bottom
Which MainAxisAlignment value evenly spaces children including start and end edges?
AspaceEvenly
BspaceAround
CspaceBetween
Dcenter
If children in a Row have different heights, which CrossAxisAlignment makes them all match the tallest child?
Astart
Bcenter
Cstretch
Dend
Which property would you use to push all children to the end of a Column?
ACrossAxisAlignment.end
BCrossAxisAlignment.start
CMainAxisAlignment.start
DMainAxisAlignment.end
Explain how MainAxisAlignment and CrossAxisAlignment work differently in a Row and a Column.
Think about which axis is horizontal or vertical in each widget.
You got /5 concepts.
    Describe a real-life scenario where you would use MainAxisAlignment.spaceBetween in a Flutter layout.
    Imagine arranging objects on a shelf with equal gaps.
    You got /3 concepts.