flutter_pagination_data 0.0.1
flutter_pagination_data: ^0.0.1 copied to clipboard
pagination package
This package helps in the bagging process when receiving data from the Internet, reduces the number of requests, and get data that fits on one page.
Features #
A Pagination Library for Flutter (with Web Support).
Getting started #
Usage #
class CustomPaginationWidget extends StatelessWidget {
const CustomPaginationWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return CustomPagination<NewsData>(
separatorWidget: SizedBox(
height: 10.0,
),
itemBuilder: (BuildContext context, item) {
return ListTile(
title:
Text(item.title),
subtitle: Text(item.description),
leading: IconButton(
icon: Icon(Icons.more_horiz),
onPressed: () => print(item.id),
),
onTap: () => print(item.source),
trailing: Icon(
Icons.add,
),
);
},
fetchMethod: fetchMethod,
onError: (error) => Center(
child: Text('Error'),
),
onEmpty: Center(
child: Text('Empty'),
),
);
}
}