Flutter Material UI MainAxisAlignment Enum

How the children should be placed along the main axis in a flex layout.


MainAxisAlignment Constants

  • MainAxisAlignment.center: Place the children as close to the middle of the main axis as possible.

  • MainAxisAlignment.end: Place the children as close to the end of the main axis as possible.

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

  • MainAxisAlignment.spaceBetween: Place the free space evenly between the children.

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

  • MainAxisAlignment.start: Place the children as close to the start of the main axis as possible.

  • MainAxisAlignment.values: A constant List of the values in this enum, in order of their declaration.


Reference