Cyrus Pagination
A library for easily displaying paginated data, created by Um Kithya.
Cyrus Pagination comes in handy when building features like activity feeds, news feeds, or anywhere else where you need to lazily fetch and render content for users to consume.
Example
![]() |
![]() |
Usage for List
A basic implementation requires four parameters:
- An
onRefreshthat is refresh function call when pull to refresh like refresh indicator. - A
widgetthat is item child widget. - A
fetchDatathat is an function to fetch api. - An
itemListthat is a list of item. - A
loadingthat is variable for loading state. - A
pagethat is variable for page number state. - An
hasMoreDatathat is variable its true when data has more. - An
endthat is variable its true when page equals total page.
Example Simple
CyrusPagination<PassagerModel>(
onRefresh: () async {
setState(() {
page = 1;
end = false;
});
await fetchApi();
},
loading: loading,
itemList: passagerList,
page: page,
end: end,
fetchData: () => fetchApi(),
widget: (data, index) => Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomCard(
description: data.name,
title: "$index",
),
),
hasMoreData: isMoreData,
),
Example Grid
CyrusPagination<PassagerModel>(
isGridView: true,
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisSpacing: 1,
mainAxisSpacing: 10,
crossAxisCount: 2,
childAspectRatio: 3 / 4.5,
),
onRefresh: () async {
setState(() {
page = 1;
end = false;
});
await fetchApi();
},
loading: loading,
itemList: passagerList,
page: page,
end: end,
fetchData: () => fetchApi(),
widget: (data, index) => Padding(
padding: const EdgeInsets.only(bottom: 10),
child: CustomCard(
description: data.name,
title: "$index",
),
),
hasMoreData: isMoreData,
),
Copyright & License
This open source project authorized by UM KITHYA , and the license is MIT.

