class CoursesResponseModel { bool? success; int? status; String? username; List? coursesStatus; int? totalCourses; CoursesResponseModel({ this.success, this.status, this.username, this.coursesStatus, this.totalCourses, }); CoursesResponseModel.fromJson(Map json) { success = json['success']; status = json['status']; username = json['username']; if (json['courses_status'] != null) { coursesStatus = []; json['courses_status'].forEach((v) { coursesStatus!.add(CourseStatus.fromJson(v)); }); } totalCourses = json['total_courses']; } Map toJson() { Map data = {}; data['success'] = success; data['status'] = status; data['username'] = username; if (coursesStatus != null) { data['courses_status'] = coursesStatus!.map((v) => v.toJson()).toList(); } data['total_courses'] = totalCourses; return data; } } class CourseStatus { String? cId; String? cFullname; String? cNameAr; String? cShortname; String? cStatus; String? cIsMohemmAffective; String? cStartdate; String? cEnddate; String? cUrl; CourseStatus({ this.cId, this.cFullname, this.cNameAr, this.cShortname, this.cStatus, this.cIsMohemmAffective, this.cStartdate, this.cEnddate, this.cUrl, }); CourseStatus.fromJson(Map json) { cId = json['c_id']; cFullname = json['c_fullname']; cNameAr = json['c_name_ar']; cShortname = json['c_shortname']; cStatus = json['c_status']; cIsMohemmAffective = json['c_is_mohemm_affective']; cStartdate = json['c_startdate']; cEnddate = json['c_enddate']; cUrl = json['c_url']; } Map toJson() { Map data = {}; data['c_id'] = cId; data['c_fullname'] = cFullname; data['c_name_ar'] = cNameAr; data['c_shortname'] = cShortname; data['c_status'] = cStatus; data['c_is_mohemm_affective'] = cIsMohemmAffective; data['c_startdate'] = cStartdate; data['c_enddate'] = cEnddate; data['c_url'] = cUrl; return data; } }