close

How to Manage Space Between Column’s Children In Flutter?

Hello Guys How are you all? Hope you all are fine. Suppose I have a Column widget with two TextField widgets as children and I want to have some space between both of them. In this tutorial, we are going to learn How to Manage Space Between Column’s Children In Flutter? So without wasting your time, Let’s start this tutorial.

How to Manage Space Between Column’s Children In Flutter?

  1. How to Manage Space Between Column’s Children In Flutter?

    To Manage Space Between Column’s Children In Flutter here are many method You can use Padding to Manage Space Between Column’s Children. You can use SizedBox with a specific height to Manage Space Between Column’s Children. You can use Wrap instead of Column to Manage Space Between Column’s Children

  2. Manage Space Between Column’s Children In Flutter

    To Manage Space Between Column’s Children In Flutter here are many method You can use Padding to Manage Space Between Column’s Children. You can use SizedBox with a specific height to Manage Space Between Column’s Children. You can use Wrap instead of Column to Manage Space Between Column’s Children

1. Use Padding

You can use Padding to Manage Space Between Column’s Children. Here is an example.

Example

Column(
  children: <Widget>[
  Padding(
    padding: EdgeInsets.all(8.0),
    child: Text('Text 1'),
  ),
  Padding(
    padding: EdgeInsets.all(8.0),
    child: Text('Text 2'),
  )
]);

Output

You can use Padding to Manage Space Between Column’s Children. Here is an example.

2. Use SizedBox

You can use SizedBox with a specific height to Manage Space Between Column’s Children. Here is an example.

Example

Column(
  children: <Widget>[
    Text('Text 1'),
    SizedBox(height: 100),
    Text('Text 2'),
  ],
),

Output

You can use SizedBox with a specific height to Manage Space Between Column’s Children. Here is an example.

3. Use Wrap()

You can use Wrap instead of Column to Manage Space Between Column’s Children. Here is an example.

Example

     Wrap(
          direction: Axis.vertical, // make sure to set this
          spacing: 20, // set your spacing
          children: <Widget>[
            Text('Text 1'),
            Text('Text 2'),
          ],
        ),
      ),

Output

You can use Wrap instead of Column to Manage Space Between Column’s Children. Here is an example.

4. Use Spacer

You can use Spacer to Manage Space Between Column’s Children. Here is an example.

Example

Column(
  children: <Widget>[
    Widget1(),
    Spacer(), // use Spacer
    Widget2(),
  ],
)

Output

You can use Spacer to Manage Space Between Column’s Children. Here is an example.

5. Use Container

You can use Container to Manage Space Between Column’s Children. Here is an example.

Example

Column(
  children: <Widget>[
     Text('Text 1'),
    Container(height: 30), // set height
     Text('Text 2'),
  ],
)

Output

You can use Container to Manage Space Between Column’s Children. Here is an example.

6. Use Expanded

You can use Expanded to Manage Space Between Column’s Children. Here is an example.

Example

Column(
  children: <Widget>[
  Text('Text 1'),
  Expanded(child: SizedBox()),
  Text('Text 2'),
  ],
)

Output

You can use Expanded to Manage Space Between Column’s Children. Here is an example.

Summery

So it’s all About How to Manage Space Between Column’s Children In Flutter?. Hope this above-all solution helped you a lot. Comment below Your thoughts and your queries. Comment Below on your suggestion.

Check Out Below Article

Leave a Comment

%d bloggers like this: