Show Item Separator From ListView Using Flutter

In this article I will share with you how to add sepreter in Listview. ListView makes its children scroll. Most of the time, we require a separator to distinguish between every child of ListView. This separator is basically a divider, which can be a line. 

ListView.separated(
  itemCount: data.length,
  separatorBuilder: (BuildContext context, int index) => Divider( height: 3, color: Colors.white),
  itemBuilder: (BuildContext context, int index) {
	return Container(
  	height: 150,
  	color: Colors.red,
  	child: Center(
   child: Text('${data[index]}'),
),
      );
   }
)

I hope it will help you. 

Tags: