quire-io/scroll-to-index

How do I get a current Index

Opened this issue · 1 comments

My concern is how do I get a currentIndex, while user is scrolling.

I saw on AutoScrollController we don't get a index, will you please tell me how can I get a current Index ??

You can use flutter_scrollview_observer to observe ScrollView, it will tell you which items are being displayed and thus know the currentIndex from resultModel.firstChild?.index.

ListViewObserver(
  child: _buildListView(),
  onObserve: (resultModel) {
    print('firstChild.index -- ${resultModel.firstChild?.index}');
    print('displaying -- ${resultModel.displayingChildIndexList}');
  },
)