class PopularMangaModelComick { int? id; String? hid; String? slug; String? title; String? rating; String? bayesianRating; int? ratingCount; int? followCount; String? desc; double? lastChapter; bool? translationCompleted; int? viewCount; String? contentRating; int? demographic; List? genres; int? userFollowCount; int? year; List? mdTitles; List? mdCovers; MuComics? muComics; String? coverUrl; PopularMangaModelComick( {this.id, this.hid, this.slug, this.title, this.rating, this.bayesianRating, this.ratingCount, this.followCount, this.desc, this.lastChapter, this.translationCompleted, this.viewCount, this.contentRating, this.demographic, this.genres, this.userFollowCount, this.year, this.mdTitles, this.mdCovers, this.muComics, this.coverUrl}); PopularMangaModelComick.fromJson(Map json) { id = json['id']; hid = json['hid']; slug = json['slug']; title = json['title']; rating = json['rating']; bayesianRating = json['bayesian_rating']; ratingCount = json['rating_count']; followCount = json['follow_count']; desc = json['desc']; lastChapter = double.parse(json['last_chapter'].toString()); translationCompleted = json['translation_completed']; viewCount = json['view_count']; contentRating = json['content_rating']; demographic = json['demographic']; genres = json['genres'].cast(); userFollowCount = json['user_follow_count']; year = json['year']; if (json['md_titles'] != null) { mdTitles = []; json['md_titles'].forEach((v) { mdTitles!.add(MdTitles.fromJson(v)); }); } if (json['md_covers'] != null) { mdCovers = []; json['md_covers'].forEach((v) { mdCovers!.add(MdCovers.fromJson(v)); }); } muComics = json['mu_comics'] != null ? MuComics.fromJson(json['mu_comics']) : null; coverUrl = json['cover_url']; } Map toJson() { final Map data = {}; data['id'] = id; data['hid'] = hid; data['slug'] = slug; data['title'] = title; data['rating'] = rating; data['bayesian_rating'] = bayesianRating; data['rating_count'] = ratingCount; data['follow_count'] = followCount; data['desc'] = desc; data['last_chapter'] = lastChapter as int; data['translation_completed'] = translationCompleted; data['view_count'] = viewCount; data['content_rating'] = contentRating; data['demographic'] = demographic; data['genres'] = genres; data['user_follow_count'] = userFollowCount; data['year'] = year; if (mdTitles != null) { data['md_titles'] = mdTitles!.map((v) => v.toJson()).toList(); } if (mdCovers != null) { data['md_covers'] = mdCovers!.map((v) => v.toJson()).toList(); } if (muComics != null) { data['mu_comics'] = muComics!.toJson(); } data['cover_url'] = coverUrl; return data; } } class MdTitles { String? title; MdTitles({this.title}); MdTitles.fromJson(Map json) { title = json['title']; } Map toJson() { final Map data = {}; data['title'] = title; return data; } } class MdCovers { int? w; int? h; String? b2key; MdCovers({this.w, this.h, this.b2key}); MdCovers.fromJson(Map json) { w = json['w']; h = json['h']; b2key = json['b2key']; } Map toJson() { final Map data = {}; data['w'] = w; data['h'] = h; data['b2key'] = b2key; return data; } } class MuComics { int? year; MuComics({this.year}); MuComics.fromJson(Map json) { year = json['year']; } Map toJson() { final Map data = {}; data['year'] = year; return data; } }