fetchBooksList method

Future<MyResponse<Book>> fetchBooksList()

Implementation

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