An easy Flutter package that enables data pagination from a network source.
By utilizing your widget, you can easily call API data by incorporating the URL and query parameters.
add dio into the dependencies section in your pubspec.yaml:
easy_network_infinite_scroll_pagination:
EasyNetworkInfiniteScrollPagination(
data: (d) {
print("data=====>>> ${d}");
},
url: "http://xxx/api/services",
child: (r) {
return Container(
margin: const EdgeInsets.all(8),
padding: const EdgeInsets.all(8),
color: Colors.green,
child: Text(r['id'].toString() + r['name']['ar'].toString()));
},
urlParameters: const {
"interested_category_ids": "[18]",
"perPage": "4",
},
numberOfPostsPerRequest: 4,
initialPageNumber: 1,
function: (Response r){
return r.data['data'];
},)