Search packages, repositories and app categories

Package detailsv1.3.0

lazy_load_scrollview

A wrapper for a ScrollView that will trigger a callback when the bottom of the page is reached

AndroidiOSWebmacOSWindowsLinux
30-day downloads
22.7K
Likes
434
Pub points
150

Install package

flutter pub add lazy_load_scrollview

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that wraps a ScrollView to trigger a callback when the user reaches the bottom of the scrollable content. It is designed for implementing infinite scrolling or lazy loading in lists and grids, making it ideal for paginated data retrieval. The package works across all major platforms including Android, iOS, Web, macOS, Windows, and Linux. It simplifies the process of detecting scroll position and loading more data dynamically without requiring complex custom logic.

Use cases

  • Infinite scrolling lists
  • Lazy loading images or data
  • Paginated content in web apps
  • Dynamic list updates
  • Loading more items on scroll

Key features

  • Automatic bottom detection
  • Cross-platform support
  • Simple callback mechanism
  • Minimal boilerplate
  • Works with ListView, GridView, and other scrollables

Suitable for

  • Developers building paginated UIs
  • Apps with large datasets
  • Content-heavy interfaces
  • Web and mobile applications needing dynamic loading

Considerations

  • Requires proper handling of loading states
  • May need debounce for rapid scrolling
  • Not suitable for fixed-size lists
  • Should be combined with error handling
  • Performance depends on data source efficiency

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Lazy load scrollview

A wrapper for a ScrollView that will enable lazy loading

Usage

Add lazy_load_scrollview dependency to your pubspec.yaml:

dependencies:
  lazy_load_scrollview: 1.3.0

In your Dart code, import package:lazy_load_scrollview/lazy_load_scrollview.dart Then you can wrap your ListView, GridView, RefreshIndicator etc with the LazyLoadScrollView. Make sure you add an endOfPageListener which will receive the call when the bottom of the list has been reached.

import 'package:lazy_load_scrollview/lazy_load_scrollview.dart';


@override
Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: LazyLoadScrollView(
        onEndOfPage: () => loadMore(),
        child: ListView.builder(
          itemCount: data.length,
          itemBuilder: (context, position) {
            return Text("Position $position");
          },
        ),
      ),
    );
}

Class definition


LazyLoadScrollView(
  endOfPageListener: () => loadMore(), // The callback when reaching the end of the list
  scrollOffset: 100 // Pixels from the bottom that should trigger a callback 
  child: Widget, // A subclass of `ScrollView`
);

Categories

Source repository

Projects using this package