INNER CODE UNIT · Dart
_contexts
rvamsikrishna/inview_notifier_list · lib/src/inview_state.dart:47
_contexts = _contexts.skip(_contexts.length - letRemain).toSet();
}
}
///Checks if the widget with the `id` is currently in-view or not.
bool inView(String id) {
return _currentInViewIds.contains(id);
}
///The listener that is called when the list view is scrolled.
void onScroll(ScrollNotification notification) {
// Iterate through each item to check
// whether it is in the viewport
for (final WidgetData item in _contexts) {
// Retrieve the RenderObject, linked to a specific item
final RenderObject? renderObject = item.context!.findRenderObject();
// If none was to be found, or if not attached, leave by now