INNER CODE UNIT · Dart
deltaTop
rvamsikrishna/inview_notifier_list · lib/src/inview_state.dart:80
final double deltaTop = vpOffset.offset - notification.metrics.pixels;
//distance from bottom of the widget to top of the viewport
final double deltaBottom = deltaTop +
(_scrollDirection == Axis.vertical ? size.height : size.width);
bool isInViewport = false;
//Check if the item is in the viewport by evaluating the provided widget's isInViewPortCondition condition.
isInViewport = _isInViewCondition!(deltaTop, deltaBottom, vpHeight);
if (isInViewport) {
//prevent changing the value on every scroll if its already the same
if (!_currentInViewIds.contains(item.id)) {
_currentInViewIds.add(item.id);
notifyListeners();
}
} else {
if (_currentInViewIds.contains(item.id)) {