10. Flutter - Rows / Columns
A row is a widget that holds other widgets horizontally.
A column is a widget that holds other widgets vertically.
Both can hold multiple widget childs, but cant use child, use children property instead.
mainAxis vs crossAxis:
- mainAxis is the main axis of column or row. If row, it is horizontal, else if column it is vertical.
- crossAxis is the secondary axis of column or row. If row, it is vertical, else if column it is horizontal.
Row Widget:
Row()
Row Properties:
children: <Widget>[WIDGET,WIDGET] // a array of widgets
mainAxisAlignment: MainAlignmentAxis.ALIGNMENTMETHOD // aligns widgets horizontally
crossAxisAlignment: CrossAlignmentAxis.ALIGNMENTMETHOD // aligns widgets vertically
Column Widget:
Column()
Column Properties:
children: <Widget>[WIDGET,WIDGET] // a array of widgets
mainAxisAlignment: MainAlignmentAxis.ALIGNMENTMETHOD // aligns widgets vertically
crossAxisAlignment: CrossAlignmentAxis.ALIGNMENTMETHOD // aligns widgets horizontally
Comments
Post a Comment