How to Put Two ListView In a Column

How to Put Two ListView In a Column?

ListView Widget is one of the important widget types that can be used anywhere. ListView Widget has been introduced to reduce the overload of having various layouts performing the same task so in this article we will go through How to Put Two ListView In a Column?

How to Put Two ListView In a Column?

You need to provide Constrained Height to be able to put ListView Widget inside Column Widget. There are many ways of doing it, I am listing a few here.

Column(
  children: <Widget>[
    Expanded(child: _list1()),
    Expanded(child: _list2()),
  ],
)
  • Give one Expanded Widget and other SizedBox.
    Column(
      children: <Widget>[
        Expanded(child: _list1()),
        SizedBox(height: 200, child: _list2()),
      ],
    )
  • Use a SizedBox Widget For both of them.
    Column(
      children: <Widget>[
        SizedBox(height: 200, child: _list1()),
        SizedBox(height: 200, child: _list2()),
      ],
    )
  • Use Flexible Widget and you can change flex property in it, just like Expanded
Column(
  children: <Widget>[
    Flexible(child: _list1()),
    Flexible(child: _list2()),
  ],
)
  • Depending on the size of a ListView and ListView is short enough to fit into the Column Widget.
    ListView(shrinkWrap: true)

Conclusion:

In this article, We have been through How to Put Two ListView In a Column Widget?

Thanks for Reading!!! Keep Learning.

Do let us know if you need any assistance with Flutter Development?

 

Nirali Patel

Written by Nirali Patel

Nirali Patel is a dedicated Flutter developer with over two years of experience, specializing in creating seamless mobile applications using Dart. With a passion for crafting user-centric solutions, Nirali combines technical proficiency with innovative thinking to push the boundaries of mobile app development.

ready to get started?

Fill out the form below and we will be in touch soon!

"*" indicates required fields

✓ Valid number ✕ Invalid number
our share of the limelight

as seen on