Space between Column's children in Flutter

后端 未结 14 796
刺人心
刺人心 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:34

    You can use Padding widget in between those two widget or wrap those widgets with Padding widget.

    Update

    SizedBox widget can be use in between two widget to add space between two widget and it makes code more readable than padding widget.

    Ex:

    Column(
      children: <Widget>[
        Widget1(),
        SizedBox(height: 10),
        Widget2(),
      ],
    ),
    
    0 讨论(0)
  • Column(children: <Widget>[
       Container(margin: EdgeInsets.only(top:12, child: yourWidget)),
       Container(margin: EdgeInsets.only(top:12, child: yourWidget))
    ]);
    
    0 讨论(0)
提交回复
热议问题