fetchChaptersList method

Future<MyResponse<Chapter>> fetchChaptersList()

Implementation

Future<MyResponse<Chapter>> fetchChaptersList() async {
  var response = await DioUtils.request(DioUtils.REQUEST_GET, Apis.FETCH_ALL_CHAPTERS);
  if (response.statusCode == 200) {
    return MyResponse<Chapter>.fromJson(response.data,Apis.LIST);
  } else {
    return MyResponse<Chapter>.init(Apis.CODE_ERROR, null, null);
  }
}