Introduction
Hi friends!! In this article, you will learn about the ListView widget and several types of ListView widgets available in Flutter. In Flutter, a ListView is really good widget when we have a list of items, and we want to display them vertically or horizontally. It provides scrolling automatically when the content exceeds the available screen space.

Source:-"Flutter Flow"
There are several types of ListView widgets available in Flutter. Each widget has its own characteristics and use cases. Some of the most commonly used ListView widgets are as follows.
- ListView
- ListView.builder
- ListView.separated
ListView in Flutter
ListView is the most basic widget that uses for displaying a list of items. ListView is a great choice if we have a static and short amount of data.
Syntax
ListView(
children: <Widget>[
// List of child widgets
],
)
Example
Widget buildListView() {
return ListView(
children: const [
Text("Item 1"),
SizedBox(height: 10,),
Text("Item 2"),
SizedBox(height: 10,),
Text("Item 3"),
SizedBox(height: 10,),
Text("Item 4"),
SizedBox(height: 10,),
Text("Item 5"),
SizedBox(height: 10,),
Text("Item 6"),
SizedBox(height: 10,),
Text("Item 7"),
SizedBox(height: 10,),
Text("Item 8"),
SizedBox(height: 10,),
Text("Item 9"),
SizedBox(height: 10,),
Text("Item 10"),
SizedBox(height: 10,),
Text("Item 11"),
SizedBox(height: 10,),
Text("Item 12"),
SizedBox(height: 10,),
Text("Item 13"),
SizedBox(height: 10,),
Text("Item 14"),
SizedBox(height: 10,),
Text("Item 15"),
SizedBox(height: 10,),
Text("Item 16"),
SizedBox(height: 10,),
Text("Item 17"),
SizedBox(height: 10,),
Text("Item 18"),
SizedBox(height: 10,),
Text("Item 19"),
SizedBox(height: 10,),
Text("Item 20"),
],
);
}
Here we are defining a function name buildListView() that will return a ListView Widget. Inside the ListView, there is a list of children, which are the items you want to display in the list. Inside children, we take a Text and a SizeBox. SizeBox is used for spacing purposes.
Output

Gaurav KumarPosted Aug 11, 2023, 6:09 AM
Very good example @Abhishek Singhal, can we scroll both resturants and dishes at same time horizontally back and forth?