fetchData method
Implementation
Future<List<InfiniteScrollPODO>> fetchData(url, nextPage) async {
print('page number $nextPage');
try {
Response response = await _restClient.get('$url?page=$nextPage');
RequestResponse parseResponse = response.data;
return InfiniteScrollPODO().fromJsonArr(parseResponse.data);
} on DioError catch (e) {
print('error one');
throw e.error;
} catch (e) {
throw e.toString();
}
}