class DoctorsConsultation { List? consultationCenter; DoctorsConsultation({ this.consultationCenter, }); Map toJson() => { 'consultationCenter': consultationCenter ?.map((consultationCenter) => consultationCenter.toJson()) .toList(), }; static DoctorsConsultation fromJson(Map json) => DoctorsConsultation( consultationCenter: (json['consultationCenter'] as List?) ?.map((schedule) => ConsultationCenter.fromJson(schedule)) .toList(), ); } class ConsultationCenter { String? floorBuilding; String? street; String? city; String? state; String? country; String? postalCode; String? documentId; String? addressType; String? consultationFee; String? averageDurationMinutes; List? weeklySchedule; ConsultationCenter({ this.addressType, this.documentId, this.floorBuilding, this.street, this.city, this.state, this.country, this.postalCode, this.consultationFee, this.averageDurationMinutes, this.weeklySchedule, }); Map toJson() => { 'floorBuilding': floorBuilding, 'documentId': documentId, 'street': street, 'city': city, 'state': state, 'country': country, 'postalCode': postalCode, 'addressType': addressType, 'consultationFee': consultationFee, 'averageDurationMinutes': averageDurationMinutes, 'weeklySchedule': weeklySchedule?.map((schedule) => schedule.toJson()).toList(), }; static ConsultationCenter fromJson(Map json) => ConsultationCenter( // id:json['id'] floorBuilding: json['floorBuilding'], documentId: json['documentId'], street: json['street'], city: json['city'], state: json['state'], country: json['country'], postalCode: json['postalCode'], addressType: json['addressType'], consultationFee: json['consultationFee'], averageDurationMinutes: json['averageDurationMinutes'], weeklySchedule: (json['weeklySchedule'] as List?) ?.map((schedule) => AvailabilitySchedule.fromJson(schedule)) .toList(), ); } class AvailabilitySchedule { String? day; List? timeSlots; AvailabilitySchedule({ this.day, this.timeSlots, }); Map toJson() => { 'day': day, 'timeSlots': timeSlots?.map((slot) => slot.toJson()).toList(), }; static AvailabilitySchedule fromJson(Map json) => AvailabilitySchedule( day: json['day'], timeSlots: (json['timeSlots'] as List?) ?.map((slot) => TimeSlot.fromJson(slot)) .toList(), ); } class TimeSlot { String? startTime; String? endTime; TimeSlot({ this.startTime, this.endTime, }); Map toJson() => { 'startTime': startTime, 'endTime': endTime, }; static TimeSlot fromJson(Map json) => TimeSlot( startTime: json['startTime'], endTime: json['endTime'], ); }