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.stops != null) {
    json[r'stops'] = this.stops;
  } else {
    json[r'stops'] = null;
  }
    json[r'segments'] = this.segments;
  return json;
}