Asad Amin
Asad Amin

Reputation: 33

How to use Listview.builder in Column and make them scrollable horizontally in flutter?

code

Is there any way to use SingleChildScrollView and pass Column as a child and ListView.builder in that column?

I just want something like shown in the attached photo.

Upvotes: 1

Views: 762

Answers (2)

Abraham Bossey
Abraham Bossey

Reputation: 11

One way to solve this is by passing the ListView.builder widget in an Expanded widget. A listview already has a SingleChildScrollview feature, You can easily remove it. and replace it with Expanded Widget a link to the code snippet....

Upvotes: 1

FrancescoPenasa
FrancescoPenasa

Reputation: 280

One way to do what you aim to do is the Scrollable Widget https://api.flutter.dev/flutter/widgets/Scrollable-class.html

Another way is to set the scrollDirection: Axis.horizontal https://docs.flutter.dev/cookbook/lists/horizontal-list

From the code you post I think you are aiming to something like this Horizontal ListView inside a Vertical ScrollView in Flutter

Upvotes: 1

Related Questions