Skip to content
pubscout

infinite_scroll_pagination

5.1.1, released a year ago by edsonbueno.com

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

Flutter FavoriteWASM-ready
$ flutter pub add infinite_scroll_pagination
Source repository

What it does

Provides out-of-the-box Sliver and standard List and Grid widgets that automatically fetch and display new pages of data as the user scrolls. It manages pagination state and supports custom error, progress, and empty indicators.

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

Use it when

  • You need to implement infinite scrolling or lazy loading pagination for lists and grids.
  • You want an architecture-agnostic pagination controller that works with any state management solution.

Skip it when

  • Your entire dataset easily fits in memory and does not need to be loaded in pages.
  • You are not using Flutter widgets or scrolling views.

Strengths

  • Architecture-agnostic and API-agnostic, works with any backend and state management approach.
  • Includes layout widgets for lists, grids, and masonry layouts out of the box.
  • Highly customizable indicators and extensible design.

Weaknesses

  • Requires manual configuration of page keys and fetching logic.
  • Major version updates can introduce breaking changes to controller and state APIs.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
4
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.lastPageIsEmpty ? null : state.nextIntPageKey,
    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),
      ),
    ),
  );
}

Alternatives

Packages that do the same job and could replace infinite_scroll_pagination.

Works with

Packages commonly used together with infinite_scroll_pagination: ones it builds on, ones built on it, and its own family.