When to use main Axis Alignment and cross Axis Alignment?
When to use main Axis Alignment and cross Axis Alignment?
In Flutter, mainAxisAlignment and crossAxisAlignment are used to control the alignment of child widgets within a Row or Column widget. The main axis is the axis along which the children are laid out, while the cross axis is perpendicular to the main axis.
When to use mainAxisAlignment:
mainAxisAlignment to align the children along the main axis of a Row or Column.Row, mainAxisAlignment aligns the children horizontally.Column, mainAxisAlignment aligns the children vertically.mainAxisAlignment include start, end, center, spaceBetween, spaceAround, and spaceEvenly.When to use crossAxisAlignment:
crossAxisAlignment to align the children along the cross axis of a Row or Column.Row, crossAxisAlignment aligns the children vertically.Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.