getBookingById method

Future<void> getBookingById(
  1. String bookingId
)

Implementation

Future<void> getBookingById(String bookingId) async {
  isSearching.value = true;
  var response = await Requests.getDio().get("booking/$bookingId");
  if (response.statusCode == 200) {
    selectedBooking.value = BookingHistory.fromJson(response.data['data']);
    selectedBooking.refresh();
    log('booking${selectedBooking.value}');
    isSearching.value = false;
    isSearching.refresh();
  } else {
    if (kDebugMode) {
      CustomFlashWidget.showFlashMessage(
          title: "Failed",
          message:
              "Error while fetching the booking details. Please try again later!",
          type: FlashType.error);
    }
    isSearching.value = false;
  }
}