BookingDetails.fromJson constructor

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

Implementation

BookingDetails.fromJson(Map<String, dynamic> json) {
  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'];
  totalOnlinePrice = json['totalOnlinePrice'];
  discountPercentage = json['discountPercentage'];
  totalDiscountedPrice = json['totalDiscountedPrice'];
  currency = json['currency'];
  bookingURL = json['bookingURL'];
  agentId = json['agentId'];
  fromAirportId = json['fromAirportId'];
  toAirportId = json['toAirportId'];
  duePaymentDetails = json['duePaymentDetails'];
  createdAt = json['createdAt'];
  updatedAt = json['updatedAt'];
  fromAirport = json['fromAirport'] != null
      ?  Airports.fromJson(json['fromAirport'])
      : null;
  toAirport = json['toAirport'] != null
      ?  Airports.fromJson(json['toAirport'])
      : null;
  subscriber = json['Subscriber'] != null
      ? SubscriberModel.fromJson(json['Subscriber'])
      : null;
  if (json['bookingLogs'] != null) {
    bookingLogs = <BookingLogs>[];
    json['bookingLogs'].forEach((v) {
      bookingLogs!.add(BookingLogs.fromJson(v));
    });
  }
  agent = json['agent'] != null ?  Agent.fromJson(json['agent']) : null;
  usedNeoMiles = json['usedNeoMiles'] ?? false;
  neoMilesPercentage = json['neoMilesPercentage'];
  comment = json['comment'];
  isDiscountedFlight = json["isDiscountedFlight"];
  totalTax = json['totalTax'];
  if (json['bookingTrips'] != null) {
    bookingTrips = <BookingTrips>[];
    json['bookingTrips'].forEach((v) {
      bookingTrips!.add(BookingTrips.fromJson(v));
    });
  }
  profit = json['profit'];
  donationAmount = json['donationAmount'];
  searchCreditUsed = json['searchCreditUsed'];
  neoMilesTransactionId = json['neoMilesTransactionId'];
  flightSubClass = json ['flightSubClass'];
  paymentId = json['paymentId'];
  grandTotal = json['grandTotal'];
  if (json['passengers'] != null) {
    passengers = <Passengers>[];
    json['passengers'].forEach((v) {
      passengers!.add(Passengers.fromJson(v));
    });
  }
}