class SectionModel { SectionModel({ this.status, this.error, this.progress, required this.data, }); int? status; bool? error; int? progress; List> data; factory SectionModel.fromJson(Map json) => SectionModel( status: json["status"], error: json["error"], progress: json["progress"], data: List>.from(json["data"].map((x) => Map.from(x) .map((k, v) => MapEntry(k, Datum.fromJson(v))))), ); Map toJson() => { "status": status, "error": error, "progress": progress, "data": List.from(data.map((x) => Map.from(x) .map((k, v) => MapEntry(k, v.toJson())))), }; } class Datum { Datum({ this.sectionTitle, this.dataLesson, }); String? sectionTitle; List? dataLesson; factory Datum.fromJson(Map json) => Datum( sectionTitle: json["section_title"], dataLesson: List.from( json["data_lesson"].map((x) => DataLesson.fromJson(x))), ); Map toJson() => { "section_title": sectionTitle, "data_lesson": List.from(dataLesson!.map((x) => x.toJson())), }; } class DataLesson { DataLesson( {this.lessonId, this.title, this.duration, this.progress, this.attachmentType, this.videoType, this.videoUrl, this.lessonType, this.attachment, this.isSkip, this.isFinished, this.summary}); String? progress; String? lessonId; String? title; String? duration; String? attachmentType; String? videoType; String? videoUrl; String? lessonType; dynamic attachment; String? isSkip; String? summary; int? isFinished; factory DataLesson.fromJson(Map json) => DataLesson( lessonId: json["lesson_id"], title: json["title"], duration: json["duration"], progress: json["progress_video"], attachmentType: json["attachment_type"], videoType: json["video_type"], videoUrl: json["video_url"], lessonType: json["lesson_type"], attachment: json["attachment"], isSkip: json["is_skip"], isFinished: json["is_finished"], summary: json["summary"], ); get courseId => null; Map toJson() => { "lesson_id": lessonId, "title": title, "duration": duration, "progress_video": progress, "attachment_type": attachmentType, "video_type": videoType, "video_url": videoUrl, "lesson_type": lessonType, "attachment": attachment, "is_skip": isSkip, "is_finished": isFinished, "summary": summary, }; } class NewMap { NewMap({ required this.title, }); final List title; factory NewMap.fromMap(Map<String, dynamic> json) => NewMap( title: List<Title>.from(json["Title"].map((x) => Title.fromMap(x))), ); Map<String, dynamic> toMap() => { "Title": List<dynamic>.from(title.map((x) => x.toMap())), }; } class Title { Title({ this.courseId, this.lessonId, this.sectionTitle, this.lessonTitle, this.duration, this.attachmentType, this.videoType, this.videoUrl, this.lessonType, this.attachment, this.isSkip, this.isFinished, }); final String? courseId; final String? lessonId; final String? sectionTitle; final String? lessonTitle; final String? duration; final String? attachmentType; final String? videoType; final String? videoUrl; final String? lessonType; final dynamic attachment; final String? isSkip; final int? isFinished; factory Title.fromMap(Map<String, dynamic> json) => Title( courseId: json["course_id"], lessonId: json["lesson_id"], sectionTitle: json["section_title"], lessonTitle: json["lesson_title"], duration: json["duration"], attachmentType: json["attachment_type"], videoType: json["video_type"], videoUrl: json["video_url"] == '' ? 'a' : json["video_url"], lessonType: json["lesson_type"], attachment: json["attachment"], isSkip: json["is_skip"], isFinished: json["is_finished"], ); Map<String, dynamic> toMap() => { "course_id": courseId, "lesson_id": lessonId, "section_title": sectionTitle, "lesson_title": lessonTitle, "duration": duration, "attachment_type": attachmentType, "video_type": videoType, "video_url": videoUrl, "lesson_type": lessonType, "attachment": attachment, "is_skip": isSkip, "is_finished": isFinished, }; }