Search code examples
flutterdartlayoutflutter-layoutflutter-widget

why crossAxisAlignment and mainAxisAlignment is different in row and column


As we all know,

For Row:

mainAxisAlignment = Horizontal Axis crossAxisAlignment = Vertical Axis

For Column:

mainAxisAlignment = Vertical Axis crossAxisAlignment = Horizontal Axis

But my question is why this two property perform differently in this two widget, For row and column.


Solution

  • Thats really simple..main axis is always in the direction acoording to column or row and Cross axis is always in the opposite direction of column and row. So for column and row It is different. Fr column main axis is vertical and cross axis is horizontal and vice versa for row. Hope you understand!