getClaimedBusinessList function

Future<List<ListingListData>> getClaimedBusinessList(
  1. {bool showLoader = false,
  2. bool isFavourite = false,
  3. String businessText = ""}
)

Implementation

Future<List<ListingListData>> getClaimedBusinessList({bool showLoader = false, bool isFavourite = false, String businessText = ""}) async {
  if (showLoader) appStore.setLoading(true);
  try {
    String userId = appStore.userId != null ? "?user_id=${appStore.userId.toString()}&search=${businessText}" : '';
    ListingResponse res = ListingResponse.fromMap(await (handleResponse(await buildHttpResponse("${APIEndPoint.claimedListingList}$userId", method: HttpMethod.GET))));
    appStore.setLoading(false);
    return await res.data!.listingListData.validate();
  } catch (e) {
    appStore.setLoading(false);
    throw errorSomethingWentWrong;
  }
}