What is the difference between MainAxisAlignment and CrossAxisAlignment?

 

Used in Row and Column to align children.

PropertyRowColumn
mainAxisAlignmentHorizontal alignmentVertical alignment
crossAxisAlignmentVertical alignmentHorizontal alignment

Example:

Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [Text('Hello'), Text('World')], );

Comments

Popular posts from this blog

1. What is Flutter?

What is FutureBuilder and StreamBuilder?