Google News
logo
Flutter - Interview Questions
When should you use mainAxisAlignment and crossAxisAlignment?
The crossAxisAlignment and mainAxisAlignment are used to control how a row and column widget aligns with their children depending on our choice.

As Children of the Row Widget are arranged horizontally.  
For Row : 

* mainAxisAlignment = Horizontal Axis  
* crossAxisAlignment = Vertical Axis  


As Children of the Column Widget are arranged vertically.
For Column :
 
* mainAxisAlignment = Vertical Axis  
* crossAxisAlignment = Horizontal Axis
Advertisement