1

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.

My Car
  • 4,198
  • 5
  • 17
  • 50
Asad Amin
  • 11
  • 5
  • Why do you want a ListView in the Column? – Josteve Feb 16 '22 at 14:55
  • Have you tried using Slivers? It'll also help if you could provide an image of what you're trying to achieve. – Omatt Feb 16 '22 at 14:58
  • I want to make a screen that is scrollable horizontally. It consists of some text in the center and after that, a horizontal row is displayed that acts as a heading of the next rows that are fetched from API. – Asad Amin Feb 16 '22 at 15:05

2 Answers2

1

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

FrancescoPenasa
  • 220
  • 4
  • 12
1

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....