inview_notifier_list
4.1.0, released 5 months ago by an unverified publisher
Builds a ListView or CustomScrollView and notifies when widgets are on screen.
What it does
It provides scroll views (`InViewNotifierList` and `InViewNotifierCustomScrollView`) along with `InViewNotifierWidget` to track and notify when child widgets enter or leave a specific viewport condition area. It is commonly used for features like auto-playing videos or conditional data loading as the user scrolls.
AI-written summary of version 4.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to auto-play videos when they scroll into view.
- You want to trigger real-time database listeners or data fetches only for visible items in a list.
Skip it when
- You are using a standard ListView and do not need visibility tracking for its items.
- You need complex physics or non-scroll view visibility calculations.
Strengths
- Supports both ListView and CustomScrollView implementations.
- Configurable in-view viewport conditions and throttle duration.
- Allows wrapping the internal scroll view with a pull-to-refresh or shimmer wrapper via `scrollViewWrapper`.
Weaknesses
- Requires unique string IDs for every child widget that needs notifications.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
InViewNotifierList(
isInViewPortCondition: (
double deltaTop,
double deltaBottom,
double vpHeight,
) {
return deltaTop < (0.5 * vpHeight) && deltaBottom > (0.5 * vpHeight);
},
itemCount: 10,
builder: (BuildContext context, int index) {
return InViewNotifierWidget(
id: '$index',
builder: (BuildContext context, bool isInView, Widget child) {
return Container(
height: 250.0,
color: isInView ? Colors.green : Colors.red,
child: Text(isInView ? 'Is in view' : 'Not in view'),
);
},
);
},
)Alternatives
Packages that do the same job and could replace inview_notifier_list.
- loader_overlay
Show a loading overlay to prevent user interaction during async operations.
66Compare - focus_detector
Detects when your widget appears or disappears from the screen.
50Compare - touch_indicator
Show touch indicators on the screen for screencasts and app demos.
50Compare - auto_animated_list
A ListView widget that automatically animates items when the list changes.
48Compare
Works with
Packages commonly used together with inview_notifier_list: ones it builds on, ones built on it, and its own family.