toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  if (this.origin != null) {
    json[r'origin'] = this.origin;
  } else {
    json[r'origin'] = null;
  }
  if (this.destination != null) {
    json[r'destination'] = this.destination;
  } else {
    json[r'destination'] = null;
  }
  if (this.departureAt != null) {
    json[r'departureAt'] = this.departureAt!.toUtc().toIso8601String();
  } else {
    json[r'departureAt'] = null;
  }
  if (this.arrivalAt != null) {
    json[r'arrivalAt'] = this.arrivalAt!.toUtc().toIso8601String();
  } else {
    json[r'arrivalAt'] = null;
  }
  if (this.durationMinutes != null) {
    json[r'durationMinutes'] = this.durationMinutes;
  } else {
    json[r'durationMinutes'] = null;
  }
  if (this.marketingCarrier != null) {
    json[r'marketingCarrier'] = this.marketingCarrier;
  } else {
    json[r'marketingCarrier'] = null;
  }
  if (this.marketingFlightNumber != null) {
    json[r'marketingFlightNumber'] = this.marketingFlightNumber;
  } else {
    json[r'marketingFlightNumber'] = null;
  }
  if (this.operatingCarrier != null) {
    json[r'operatingCarrier'] = this.operatingCarrier;
  } else {
    json[r'operatingCarrier'] = null;
  }
  if (this.operatingFlightNumber != null) {
    json[r'operatingFlightNumber'] = this.operatingFlightNumber;
  } else {
    json[r'operatingFlightNumber'] = null;
  }
  if (this.aircraft != null) {
    json[r'aircraft'] = this.aircraft;
  } else {
    json[r'aircraft'] = null;
  }
    json[r'stops'] = this.stops;
  if (this.isCodeshare != null) {
    json[r'isCodeshare'] = this.isCodeshare;
  } else {
    json[r'isCodeshare'] = null;
  }
  return json;
}