bookingList function

Future<List<BookingList>> bookingList(
  1. {bool showLoader = true}
)

Reminder Booking list response model

Implementation

Future<List<BookingList>> bookingList({bool showLoader = true}) async {
  if (showLoader) appStore.setLoading(true);
  String userid = "?user_id=${appStore.userId}";
  String perPage = "&per_page=all";
  try {
    var res = BookingListModelResponse.fromMap(await (handleResponse(await buildHttpResponse('${APIEndPoint.bookingList}$userid$perPage', method: HttpMethod.GET))));
    if (showLoader) appStore.setLoading(false);
    appStore.setBookingList(res.bookingListreponse!.data.validate());
    return res.bookingListreponse!.data.validate();
  } catch (e) {
    appStore.setLoading(false);
    throw errorSomethingWentWrong;
  }
}