Set the space between Elements in Row Flutter

后端 未结 8 518
清酒与你
清酒与你 2021-01-30 06:20

Code:

new Container(
          alignment: FractionalOffset.center,
          child: new Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
             


        
8条回答
  •  逝去的感伤
    2021-01-30 07:11

    MainAxisAlignment

    start - Place the children as close to the start of the main axis as possible.

    end - Place the children as close to the end of the main axis as possible.

    center - Place the children as close to the middle of the main axis as possible.

    spaceBetween - Place the free space evenly between the children.

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

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

    Example:

      child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text('Row1'),
              Text('Row2')
            ],
          )
    

提交回复
热议问题