performSearch static method

dynamic performSearch({
  1. String query = "",
  2. String displaylanguage = "eng",
  3. dynamic page = 1,
})

Implementation

static performSearch(
    {String query = "", String displaylanguage = "eng", page = 1}) async {
  String url =
      "${AppUrls.baseUrlVCMS}/subscriber/v1/content/search?query=$query&displaylanguage=$displaylanguage&page=$page";
  final response = await _dio!.get(url);
  ContentModel contentModel;
  if (response.data['errorcode'] == 7109) {
    contentModel = ContentModel(totalcount: 0, data: []);
  } else {
    contentModel = ContentModel.fromMap(response.data);
  }
  return contentModel;
}