// To parse this JSON data, do // // final eventSpeakersResponse = eventSpeakersResponseFromJson(jsonString); import 'dart:convert'; EventSpeakersResponse eventSpeakersResponseFromJson(String str) => EventSpeakersResponse.fromJson(json.decode(str)); String eventSpeakersResponseToJson(EventSpeakersResponse data) => json.encode(data.toJson()); class EventSpeakersResponse { List? data; EventSpeakersResponse({ this.data, }); factory EventSpeakersResponse.fromJson(Map json) => EventSpeakersResponse( data: json["data"] == null ? [] : List.from( json["data"]!.map((x) => EventSpeakersData.fromJson(x))), ); Map toJson() => { "data": data == null ? [] : List.from(data!.map((x) => x.toJson())), }; } class EventSpeakersData { String? eid; dynamic eventTopics; String? npiNum; String? hcpPinAlias; String? sessionName; String? name; String? kolId; String? firstName; dynamic middleName; dynamic lastName; String? orgName; String? country; String? region; String? city; String? numSess; dynamic optInOutStatus; String? url1; dynamic sessionNote; String? cntNotes; String? eventAttendeesId; dynamic medicalInsightId; String? cntMedicalInsight; String? kId; String? id; int? projKolId; String? eventsSession; int? restEventsSessionCount; String? restEventsSession; String? eventsTopic; int? restEventsTopicCount; String? restEventsTopic; String? kolName; String? kolFullName; EventSpeakersData({ this.eid, this.eventTopics, this.npiNum, this.hcpPinAlias, this.sessionName, this.name, this.kolId, this.firstName, this.middleName, this.lastName, this.orgName, this.country, this.region, this.city, this.numSess, this.optInOutStatus, this.url1, this.sessionNote, this.cntNotes, this.eventAttendeesId, this.medicalInsightId, this.cntMedicalInsight, this.kId, this.id, this.projKolId, this.eventsSession, this.restEventsSessionCount, this.restEventsSession, this.eventsTopic, this.restEventsTopicCount, this.restEventsTopic, this.kolName, this.kolFullName, }); factory EventSpeakersData.fromJson(Map json) => EventSpeakersData( eid: json["eid"], eventTopics: json["event_topics"], npiNum: json["npi_num"], hcpPinAlias: json["hcp_pin_alias"], sessionName: json["session_name"], name: json["name"], kolId: json["kol_id"], firstName: json["first_name"], middleName: json["middle_name"], lastName: json["last_name"], orgName: json["org_name"], country: json["Country"], region: json["Region"], city: json["City"], numSess: json["num_sess"], optInOutStatus: json["opt_in_out_status"], url1: json["url1"], sessionNote: json["session_note"], cntNotes: json["cnt_notes"], eventAttendeesId: json["event_attendees_id"], medicalInsightId: json["medical_insight_id"], cntMedicalInsight: json["cnt_medical_insight"], kId: json["k_id"], id: json["id"], projKolId: json["proj_kol_id"], eventsSession: json["events_session"], restEventsSessionCount: json["rest_events_session_count"], restEventsSession: json["rest_events_session"], eventsTopic: json["events_topic"], restEventsTopicCount: json["rest_events_topic_count"], restEventsTopic: json["rest_events_topic"], kolName: json["kol_name"], kolFullName: json["kol_full_name"], ); Map toJson() => { "eid": eid, "event_topics": eventTopics, "npi_num": npiNum, "hcp_pin_alias": hcpPinAlias, "session_name": sessionName, "name": nameValues.reverse[name], "kol_id": kolId, "first_name": firstName, "middle_name": middleName, "last_name": lastName, "org_name": orgName, "Country": countryValues.reverse[country], "Region": region, "City": city, "num_sess": numSess, "opt_in_out_status": optInOutStatus, "url1": url1, "session_note": sessionNote, "cnt_notes": cntNotes, "event_attendees_id": eventAttendeesId, "medical_insight_id": medicalInsightId, "cnt_medical_insight": cntMedicalInsight, "k_id": kId, "id": id, "proj_kol_id": projKolId, "events_session": eventsSession, "rest_events_session_count": restEventsSessionCount, "rest_events_session": restEventsSession, "events_topic": eventsTopic, "rest_events_topic_count": restEventsTopicCount, "rest_events_topic": restEventsTopic, "kol_name": kolName, "kol_full_name": kolFullName, }; } enum Country { BELGIUM, GERMANY, UNITED_STATES } final countryValues = EnumValues({ "Belgium": Country.BELGIUM, "Germany": Country.GERMANY, "United States": Country.UNITED_STATES }); enum Name { THE_2036_AMERICAN_ACADEMY_OF_AAI } final nameValues = EnumValues({ "2036 American Academy of (AAI)": Name.THE_2036_AMERICAN_ACADEMY_OF_AAI }); enum RestEventsSession { BUSINESS_MEETING_AND_FORUM, EMPTY } final restEventsSessionValues = EnumValues({ " Business Meeting and Forum": RestEventsSession.BUSINESS_MEETING_AND_FORUM, "": RestEventsSession.EMPTY }); class EnumValues { Map map; late Map reverseMap; EnumValues(this.map); Map get reverse { reverseMap = map.map((k, v) => MapEntry(v, k)); return reverseMap; } }