fetchPageById method

Future<MyResponse<Page>> fetchPageById(
  1. int pageId
)

Implementation

Future<MyResponse<Page>> fetchPageById(int pageId) async {
  var response = await DioUtils.request(DioUtils.REQUEST_GET, "${Apis.FETCH_ALL_PAGES}$pageId");
  if (response.statusCode == 200) {
    return MyResponse<Page>.fromJson(response.data,Apis.SINGLE);
  } else {
    return MyResponse<Page>.init(Apis.CODE_ERROR, null, null);
  }
}