import 'dart:convert'; T? asT(dynamic value) { if (value is T) { return value; } return null; } class ComicUpdateItemModel { ComicUpdateItemModel({ required this.comicId, required this.title, this.islong, this.authors, this.types, this.cover, this.status, this.lastUpdateChapterName, this.lastUpdateChapterId, this.lastUpdatetime, }); factory ComicUpdateItemModel.fromJson(Map json) => ComicUpdateItemModel( comicId: asT(json['comic_id'])!, title: asT(json['title'])!, islong: asT(json['islong']), authors: asT(json['authors']), types: asT(json['types']), cover: asT(json['cover']), status: asT(json['status']), lastUpdateChapterName: asT(json['last_update_chapter_name']), lastUpdateChapterId: asT(json['last_update_chapter_id']), lastUpdatetime: asT(json['last_updatetime']), ); int comicId; String title; int? islong; String? authors; String? types; String? cover; String? status; String? lastUpdateChapterName; int? lastUpdateChapterId; int? lastUpdatetime; @override String toString() { return jsonEncode(this); } Map toJson() => { 'comic_id': comicId, 'title': title, 'islong': islong, 'authors': authors, 'types': types, 'cover': cover, 'status': status, 'last_update_chapter_name': lastUpdateChapterName, 'last_update_chapter_id': lastUpdateChapterId, 'last_updatetime': lastUpdatetime, }; }