Search code examples
flutterdartflutter-layoutflutter-listview

Find out which items in a ListView are visible


How can I find out which items are currently visible or invisible in a ListView?
For example, I have 100 items in ListView and when i scroll to top of screen or list, I want to detect which items appear or disappear from the viewport.

Illustration:

enter image description here


Solution

  • You can also use inview_notifier_list. It's basically a normal ListView which defines a visible region and it's children get notified when they are in that region.

    enter image description here