// To parse this JSON data, do // // final patientEducationJourneyListModel = patientEducationJourneyListModelFromJson(jsonString); import 'dart:convert'; PatientEducationJourneyListModel patientEducationJourneyListModelFromJson(String str) => PatientEducationJourneyListModel.fromJson(json.decode(str)); String patientEducationJourneyListModelToJson(PatientEducationJourneyListModel data) => json.encode(data.toJson()); class PatientEducationJourneyListModel { NabedJourneyResponseResult? nabedJourneyResponseResult; PatientEducationJourneyListModel({ this.nabedJourneyResponseResult, }); factory PatientEducationJourneyListModel.fromJson(Map json) => PatientEducationJourneyListModel( nabedJourneyResponseResult: json["NabedJourneyResponseResult"] == null ? null : NabedJourneyResponseResult.fromJson(json["NabedJourneyResponseResult"]), ); Map toJson() => { "NabedJourneyResponseResult": nabedJourneyResponseResult?.toJson(), }; } class NabedJourneyResponseResult { List? data; Links? links; Meta? meta; NabedJourneyResponseResult({ this.data, this.links, this.meta, }); factory NabedJourneyResponseResult.fromJson(Map json) => NabedJourneyResponseResult( data: json["data"] == null ? [] : List.from(json["data"]!.map((x) => Datum.fromJson(x))), links: json["links"] == null ? null : Links.fromJson(json["links"]), meta: json["meta"] == null ? null : Meta.fromJson(json["meta"]), ); Map toJson() => { "data": data == null ? [] : List.from(data!.map((x) => x.toJson())), "links": links?.toJson(), "meta": meta?.toJson(), }; } class Datum { List? contentClasses; DateTime? date; DefaultPocData? defaultPocData; int? id; String? integrationApproach; bool? isNew; DateTime? openedAt; String? sourceType; Stats? stats; TagValues? tagValues; Datum({ this.contentClasses, this.date, this.defaultPocData, this.id, this.integrationApproach, this.isNew, this.openedAt, this.sourceType, this.stats, this.tagValues, }); factory Datum.fromJson(Map json) => Datum( contentClasses: json["content_classes"] == null ? [] : List.from(json["content_classes"]!.map((x) => ContentClass.fromJson(x))), date: json["date"] == null ? null : DateTime.parse(json["date"]), defaultPocData: json["default_poc_data"] == null ? null : DefaultPocData.fromJson(json["default_poc_data"]), id: json["id"], integrationApproach: json["integration_approach"], isNew: json["is_new"], openedAt: json["opened_at"] == null ? null : DateTime.parse(json["opened_at"]), sourceType: json["source_type"], stats: json["stats"] == null ? null : Stats.fromJson(json["stats"]), tagValues: json["tag_values"] == null ? null : TagValues.fromJson(json["tag_values"]), ); Map toJson() => { "content_classes": contentClasses == null ? [] : List.from(contentClasses!.map((x) => x.toJson())), "date": "${date!.year.toString().padLeft(4, '0')}-${date!.month.toString().padLeft(2, '0')}-${date!.day.toString().padLeft(2, '0')}", "default_poc_data": defaultPocData?.toJson(), "id": id, "integration_approach": integrationApproach, "is_new": isNew, "opened_at": openedAt?.toIso8601String(), "source_type": sourceType, "stats": stats?.toJson(), "tag_values": tagValues?.toJson(), }; } class ContentClass { int? id; Image? image; int? readPercentage; String? title; dynamic topics; String? type; ContentClass({ this.id, this.image, this.readPercentage, this.title, this.topics, this.type, }); factory ContentClass.fromJson(Map json) => ContentClass( id: json["id"], image: json["image"] == null ? null : Image.fromJson(json["image"]), readPercentage: json["read_percentage"], title: json["title"], topics: json["topics"], type: json["type"], ); Map toJson() => { "id": id, "image": image?.toJson(), "read_percentage": readPercentage, "title": title, "topics": topics, "type": type, }; } class Image { String? thumbUrl; String? url; Image({ this.thumbUrl, this.url, }); factory Image.fromJson(Map json) => Image( thumbUrl: json["thumb_url"], url: json["url"], ); Map toJson() => { "thumb_url": thumbUrl, "url": url, }; } class DefaultPocData { Image? image; String? title; DefaultPocData({ this.image, this.title, }); factory DefaultPocData.fromJson(Map json) => DefaultPocData( image: json["image"] == null ? null : Image.fromJson(json["image"]), title: json["title"], ); Map toJson() => { "image": image?.toJson(), "title": title, }; } class Stats { int? attachmentsCount; int? contentCount; int? contentReadCount; int? educationalContentCount; int? educationalContentReadCount; int? educationalReadPercentage; bool? isCompleted; int? readPercentage; int? readRemainingPercentage; int? screenshotsCount; int? topicCount; int? videosCount; int? videosReadCount; Stats({ this.attachmentsCount, this.contentCount, this.contentReadCount, this.educationalContentCount, this.educationalContentReadCount, this.educationalReadPercentage, this.isCompleted, this.readPercentage, this.readRemainingPercentage, this.screenshotsCount, this.topicCount, this.videosCount, this.videosReadCount, }); factory Stats.fromJson(Map json) => Stats( attachmentsCount: json["attachments_count"], contentCount: json["content_count"], contentReadCount: json["content_read_count"], educationalContentCount: json["educational_content_count"], educationalContentReadCount: json["educational_content_read_count"], educationalReadPercentage: json["educational_read_percentage"], isCompleted: json["is_completed"], readPercentage: json["read_percentage"], readRemainingPercentage: json["read_remaining_percentage"], screenshotsCount: json["screenshots_count"], topicCount: json["topic_count"], videosCount: json["videos_count"], videosReadCount: json["videos_read_count"], ); Map toJson() => { "attachments_count": attachmentsCount, "content_count": contentCount, "content_read_count": contentReadCount, "educational_content_count": educationalContentCount, "educational_content_read_count": educationalContentReadCount, "educational_read_percentage": educationalReadPercentage, "is_completed": isCompleted, "read_percentage": readPercentage, "read_remaining_percentage": readRemainingPercentage, "screenshots_count": screenshotsCount, "topic_count": topicCount, "videos_count": videosCount, "videos_read_count": videosReadCount, }; } class TagValues { String? consultationCode; String? title; String? titleAr; TagValues({ this.consultationCode, this.title, this.titleAr, }); factory TagValues.fromJson(Map json) => TagValues( consultationCode: json["consultation_code"], title: json["title"], titleAr: json["title_ar"], ); Map toJson() => { "consultation_code": consultationCode, "title": title, "title_ar": titleAr, }; } class Links { String? first; String? last; dynamic next; dynamic prev; Links({ this.first, this.last, this.next, this.prev, }); factory Links.fromJson(Map json) => Links( first: json["first"], last: json["last"], next: json["next"], prev: json["prev"], ); Map toJson() => { "first": first, "last": last, "next": next, "prev": prev, }; } class Meta { int? currentPage; int? from; int? lastPage; String? path; int? perPage; int? to; int? total; Meta({ this.currentPage, this.from, this.lastPage, this.path, this.perPage, this.to, this.total, }); factory Meta.fromJson(Map json) => Meta( currentPage: json["current_page"], from: json["from"], lastPage: json["last_page"], path: json["path"], perPage: json["per_page"], to: json["to"], total: json["total"], ); Map toJson() => { "current_page": currentPage, "from": from, "last_page": lastPage, "path": path, "per_page": perPage, "to": to, "total": total, }; }