Flutter : How to add scroll indicator in ListView

user6274128 picture user6274128 · Oct 28, 2018 · Viewed 21.7k times · Source

Is there any way to show the scroll indicator on the ListView?

Here is my basic code :

ListView.builder(
  itemCount: 50,
  itemBuilder: (context, index) => ListTile(title: Text("Item= ${index + 1}"),),
)

Answer

user6274128 picture user6274128 · Oct 30, 2018

Thanks to Günter Zöchbauer.

You can wrap your ListView in Scrollbar

Scrollbar(
    child: ListView.builder(
      itemCount: 50,
      itemBuilder: (context, index) => ListTile(title: Text("Item= ${index + 1}"),),),
)