1.

When to use mainAxisAlignment and crossAxisAlignment.

Answer»

The mainAxisAlignment is how ITEMS are aligned on that axis, whereas crossAxisAlignment is how items are aligned on the other axis. ROW and COLUMN WIDGETS can align their children according to our preferences using the crossAxisAlignment and the mainAxisAlignment properties.  

As Children of the Row Widget are arranged HORIZONTALLY.  
For Row:  
mainAxisAlignment = Horizontal Axis  
crossAxisAlignment = Vertical Axis  

This can be better understood by looking at the image below:  

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

This can be better understood by looking at the image below: 



Discussion

No Comment Found