getBooking method

void getBooking(
  1. String bookingId
)

Implementation

void getBooking(String bookingId) async {
try {
  var response = await Requests.getDio(showLoadingDialog: false)
      .get('booking/$bookingId');
  if (response.statusCode == 200) {
     Map<String, dynamic> data = response.data;
  if(data.containsKey('data')){
    BookingHistory? history = data['data']!=null? BookingHistory.fromJson(data['data']) : null;
    if(history!=null){
        paymentDetails.value  =  paymentDetails.value.copyWith(
          isStillAvailable: history.isStillAvailable,
          availabilityCheckedAt: history.availabilityCheckedAt,
          availabilityCheckCounter: history.availabilityCheckCounter,
        );
        await storePayment();
    }
  }
  }
} catch (e) {
  debugPrint("Error: getbooking ${e.toString()}");
}
  }