Flutter Column MainAxisAlignment Properties Explained with Example

In today’s tutorial we would learn about Flutter MainAxisAlignment and its sub properties like center, end, space around, space between, space evenly and start. MainAxisAlignment is a property of Column widget. It is used to arrange children widgets into vertically format according to given axis. Today we would use the Column widget and make children widget into single column format in flutter. So in this tutorial we would learn about Flutter Column MainAxisAlignment Properties Explained in Android iOS with Example.

Contents in this project Flutter Column MainAxisAlignment Properties Explained with Example:

Note:- Given below all the examples is with CrossAxisAlignment.center in Column widget.

1. MainAxisAlignment.start :- Place all the given children as close at the start as possible to main axis.

Flutter Column MainAxisAlignment Properties Explained with Example

2. MainAxisAlignment.center :- Place all the children of Column widget in center as close as possible.

3. MainAxisAlignment.end :- Place the children as close as to the end of main axis.

4. MainAxisAlignment.spaceAround :- Place the free space evenly between the children widget as well as half of that space before and after the first and last child widget.

5. MainAxisAlignment.spaceBetween :- Place the free space evenly between the children widget.

6. MainAxisAlignment.spaceEvenly :- Place the free space evenly between the children widget as well as before and after the first widget and last child widget.

7. Complete source code for main.dart file:

Leave a Reply

Your email address will not be published.