BookingHistory.fromJson constructor

BookingHistory.fromJson(
  1. Map<String, dynamic> json
)

Implementation

BookingHistory.fromJson(Map<String, dynamic> json) {
  searchCredit = json['searchCredit'];
  id = json['id'];
  subscriberId = json['subscriberId'];
  status = json['status'];
  paymentHash = json['paymentHash'];
  tripType = json['tripType'];
  paymentMethod = json['paymentMethod'];
  bookingReference = json['bookingReference'];
  paymentReference = json['paymentReference'];
  departureDate = json['departureDate'];
  departureTime = json['departureTime'];
  returnDate = json['returnDate'];
  returnTime = json['returnTime'];
  passengerCount = json['passengerCount'];
  flixableDate = json['flixableDate'];
  milesEarned = json['milesEarned'];
  flightClass = json['flightClass'];
  ticketDownloadURL = json['ticketDownloadURL'];
  totalDiscountedPrice = json['totalDiscountedPrice'];
  totalOnlinePrice = json['totalOnlinePrice'];
  discountPercentage = json['discountPercentage'];
  totalTax = json['totalTax'];
  currency = json['currency'];
  bookingURL = json['bookingURL'];
  agentId = json['agentId'];
  fromAirportId = json['fromAirportId'];
  toAirportId = json['toAirportId'];
  createdAt = json['createdAt'];
  updatedAt = json['updatedAt'];
  totalDiscountedPriceBTC = json['totalDiscountedPriceBTC'];
  duePaymentDetails = json['duePaymentDetails'];
  fromAirport = json['fromAirport'] != null
      ? FromAirport.fromJson(json['fromAirport'])
      : null;
  toAirport = json['toAirport'] != null
      ? FromAirport.fromJson(json['toAirport'])
      : null;
  if (json['passengers'] != null) {
    passengers = <Passengers>[];
    json['passengers'].forEach((v) {
      passengers!.add(Passengers.fromJson(v));
    });
  }
  subscriber = json['Subscriber'] != null
      ? Subscriber.fromJson(json['Subscriber'])
      : null;
  if (json['bookingTrips'] != null) {
    bookingTrips = <BookingTrips>[];
    json['bookingTrips'].forEach((v) {
      bookingTrips!.add(BookingTrips.fromJson(v));
    });
  }
 usedNeoMiles = json['usedNeoMiles'] ?? false;
 neoMilesPercentage = json['neoMilesPercentage'];
 donationAmount = json['donationAmount'];
 isDiscountedFlight = json["isDiscountedFlight"];
 paymentId = json['paymentId'];
 grandTotal = json['grandTotal'];
 searchCreditUsed = json['searchCreditUsed'];
 neoMilesTransactionId = json['neoMilesTransactionId'];
 flightSubClass = json ['flightSubClass'];
 payment = json['payment'] != null
      ? Payment.fromJson(json['payment'])
      : null;
 confirmedRateAt = json['milesRatedAt'];
 availabilityCheckedAt = json['availabilityCheckedAt'];
 isStillAvailable = json['isStillAvailable'];
 availabilityCheckCounter = json['availabilityCheckCounter'];
 approvedAt = json['approvedAt'];
}