fetchData method

Future<List<InfiniteScrollPODO>> fetchData(
  1. dynamic url,
  2. dynamic nextPage
)
override

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();
  }
}