Space between Column's children in Flutter

后端 未结 14 825
刺人心
刺人心 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条回答
  •  猫巷女王i
    2021-02-02 05:22

    you can use Wrap() widget instead Column() to add space between child widgets.And use spacing property to give equal spacing between children

    Wrap(
      spacing: 20, // to apply margin in the main axis of the wrap
      runSpacing: 20, // to apply margin in the cross axis of the wrap
      children: [
         Text('child 1'),
         Text('child 2')
      ]
    )
    

提交回复
热议问题