Space between Column's children in Flutter

后端 未结 14 801
刺人心
刺人心 2021-02-02 04:33

I have a Column widget with two TextField widgets as children and I want to have some space between both of them.

I already tried mainAxi

14条回答
  •  粉色の甜心
    2021-02-02 05:19

    Columns Has no height by default, You can Wrap your Column to the Container and add the specific height to your Container. Then You can use something like below:

    Container(
       width: double.infinity,//Your desire Width
       height: height,//Your desire Height
       child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
             Text('One'),
             Text('Two')
          ],
       ),
    ),
    

提交回复
热议问题