rvamsikrishna / inview_notifier_list

A Flutter package that builds a list view and notifies when the widgets are on screen.
MIT License
677 stars 104 forks source link

Get current index of the visible item #13

Closed brizaldi closed 4 years ago

brizaldi commented 4 years ago

is there a way to get current index of the visible item, for example when the user press the button

rvamsikrishna commented 4 years ago

you already use builder: (BuildContext context, int index) {} to build your list items. Inside this builder using InViewNotifierWidget gives you the bool value whether the widget is in view. Use this bool to add/remove the current index to a List variable.

rvamsikrishna commented 4 years ago

@brizaldi I am closing the issue as there is no further response. Reopen it if you still have a doubt.