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.
- Use Expanded Widget for both the list
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?
FlutterAgency.com is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget Guide, Flutter Projects, Code libs and etc.
FlutterAgency.com is one of the most popular online portal dedicated to Flutter Technology and daily thousands of unique visitors come to this portal to enhance their knowledge on Flutter.