Skip to content
pubscout

lazy_load_scrollview

1.3.0, released 6 years ago by quirijngb.com

A wrapper for scrollable widgets that triggers a callback when reaching the end of the page.

WASM-ready
$ flutter pub add lazy_load_scrollview
Source repository

What it does

It wraps any ScrollView subclass, ListView, GridView, or RefreshIndicator and triggers a callback function when the user scrolls near the bottom of the page. It allows configuring a custom scroll offset in pixels from the bottom to trigger the callback early.

AI-written summary of version 1.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to implement infinite scrolling or pagination for lists and grids.
  • You want to load more items when reaching the end of a ScrollView.

Skip it when

  • You need complex state management solutions for your pagination data.
  • You are not using a subclass of ScrollView or a compatible wrapper widget.

Strengths

  • Simple wrapper widget approach with minimal configuration.
  • Supports custom scroll offset thresholds for triggering the callback.
  • Compatible with ListView, GridView, and RefreshIndicator.

Weaknesses

  • Lacks built-in state management for loading states, errors, or pagination metadata.
  • Limited documentation regarding edge cases with dynamic content sizing.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

not documented

LazyLoadScrollView(
  onEndOfPage: () => loadMore(),
  child: ListView.builder(
    itemCount: data.length,
    itemBuilder: (context, position) {
      return Text("Position $position");
    },
  ),
)

Alternatives

Packages that do the same job and could replace lazy_load_scrollview.