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.
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.
- easy_refresh
A Flutter widget providing pull-down refresh and pull-up load for all scrollable widgets.
80Compare - infinite_grouped_list
Dynamic scrolling list that efficiently groups items and loads more data as the user scrolls.
79Compare - widget_tooltip
A customizable tooltip widget for Flutter with multiple trigger modes and smart positioning
48Compare - circular_widgets
Display widgets in a circle with customizable radius and spacing.
45Compare
Works with
Packages commonly used together with infinite_scroll_pagination: ones it builds on, ones built on it, and its own family.
- flutter_staggered_grid_viewinfinite_scroll_pagination depends on itProvides a collection of custom grid layouts like staggered, masonry, quilted, and woven.
- sliver_toolsinfinite_scroll_pagination depends on itUtility sliver widgets missing from the Flutter framework
- paged_vertical_calendarBuilt on infinite_scroll_paginationA simple paginated framework for implementing calendar based interfaces.