infinite_scroll_pagination 5.0.0 copy "infinite_scroll_pagination: ^5.0.0" to clipboard
infinite_scroll_pagination: ^5.0.0 copied to clipboard

Lazily load and display pages of items as the user scrolls down your screen.

Package Logo with Flutter Favorite Badge

Chosen as a Flutter Favorite by the Flutter Ecosystem Committee

Pub.dev Badge GitHub Build Badge Code Coverage Badge Gitter Badge Effective Dart Badge MIT License Badge Flutter Platform Badge


Infinite Scroll Pagination #

Unopinionated, extensible and highly customizable package to help you lazily load and display small chunks of items as the user scrolls down the screen – known as infinite scrolling pagination, endless scrolling pagination, auto-pagination, lazy loading pagination, progressive loading pagination, etc.

Designed to feel like part of the Flutter framework.

Example Project

Tutorial #

By raywenderlich.com (step-by-step, hands-on, in-depth, and illustrated).

Usage #

class ListViewScreen extends StatefulWidget {
  const ListViewScreen({super.key});

  @override
  State<ListViewScreen> createState() => _ListViewScreenState();
}

class _ListViewScreenState extends State<ListViewScreen> {
  late final _pagingController = PagingController<int, Photo>(
    getNextPageKey: (state) => (state.keys?.last ?? 0) + 1,
    fetchPage: (pageKey) => RemoteApi.getPhotos(pageKey),
  );

  @override
  void dispose() {
    _pagingController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) => PagingListener(
    controller: _pagingController,
    builder: (context, state, fetchNextPage) => PagedListView<int, Photo>(
      state: state,
      fetchNextPage: fetchNextPage,
      builderDelegate: PagedChildBuilderDelegate(
        itemBuilder: (context, item, index) => ImageListTile(item: item),
      ),
    ),
  );
}
copied to clipboard

For more usage examples, please take a look at our cookbook or check out the example project.

Features #

Migration #

if you are upgrading the package, please check the migration guide for instructions on how to update your code.

API Overview #

API Diagram

3.67k
likes
160
points
349k
downloads

Publisher

verified publisheredsonbueno.com

Weekly Downloads

2024.09.08 - 2025.03.23

Lazily load and display pages of items as the user scrolls down your screen.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

collection, flutter, flutter_staggered_grid_view, meta, sliver_tools

More

Packages that depend on infinite_scroll_pagination