class VideoNewModel { VideoNewModel({ String? contentId, String? url, String? title, int? likeCount, int? commentCount, int? favoriteCount, int? shareCount, //List? commentList, String? coverImage, bool? isLiked, bool? isFavorite, int? viewCount, String? createTime, String? author, String? shareUrl, String? shareDesc, }) { _contentId = contentId; _url = url; _title = title; _likeCount = likeCount; _commentCount = commentCount; _favoriteCount = favoriteCount; _shareCount = shareCount; //_commentList = commentList; _coverImage = coverImage; _isLiked = isLiked; _isFavorite = isFavorite; _viewCount = viewCount; _createTime = createTime; _author = author; _shareUrl = shareUrl; _shareDesc = shareDesc; } VideoNewModel.fromJson(dynamic json) { _contentId = json['contentId']; _url = json['url']; _title = json['title']; _likeCount = json['likeCount']; _commentCount = json['commentCount']; _favoriteCount = json['favoriteCount']; _shareCount = json['shareCount']; _isLiked = json['isLiked']; _isFavorite = json['isFavorite']; _viewCount = json['viewCount']; _createTime = json['createTime']; _author = json['author']; /* if (json['commentList'] != null) { _commentList = []; json['commentList'].forEach((v) { _commentList?.add(Dynamic.fromJson(v)); }); }*/ _coverImage = json['coverImage']; _shareUrl = json['shareUrl']; _shareDesc = json['shareDesc']; } String? _contentId; String? _url; String? _title; int? _likeCount; int? _commentCount; int? _favoriteCount; int? _shareCount; bool? _isLiked; bool? _isFavorite; int? _viewCount; String? _createTime; // List? _commentList; String? _coverImage; String? _author; String? _shareUrl; String? _shareDesc; VideoNewModel copyWith({ String? contentId, String? url, String? title, int? likeCount, int? commentCount, int? favoriteCount, // List? commentList, int? shareCount, bool? isLiked, bool? isFavorite, int? viewCount, String? createTime, String? coverImage, String? author, String? shareUrl, String? shareDesc, }) => VideoNewModel( contentId: contentId ?? _contentId, url: url ?? _url, title: title ?? _title, likeCount: likeCount ?? _likeCount, commentCount: commentCount ?? _commentCount, favoriteCount: favoriteCount ?? _favoriteCount, // commentList: commentList ?? _commentList, shareCount: shareCount ?? _shareCount, coverImage: coverImage ?? _coverImage, isLiked: isLiked ?? _isLiked, isFavorite: isFavorite ?? _isFavorite, viewCount: viewCount ?? _viewCount, createTime: createTime ?? _createTime, author: author ?? _author, shareUrl:shareUrl ?? _shareUrl, shareDesc:shareDesc ?? _shareDesc, ); String? get contentId => _contentId; String? get url => _url; String? get title => _title; int? get likeCount => _likeCount; int? get commentCount => _commentCount; int? get favoriteCount => _favoriteCount; int? get shareCount => _shareCount; bool? get isLiked => _isLiked; bool? get isFavorite => _isFavorite; int? get viewCount => _viewCount; String? get createTime => _createTime; // List? get commentList => _commentList; String? get coverImage => _coverImage; String? get author => _author; String? get shareUrl=> _shareUrl; String? get shareDesc=> _shareDesc; Map toJson() { final map = {}; map['contentId'] = _contentId; map['url'] = _url; map['title'] = _title; map['likeCount'] = _likeCount; map['commentCount'] = _commentCount; map['favoriteCount'] = _favoriteCount; map['shareCount'] = _shareCount; /* if (_commentList != null) { map['commentList'] = _commentList?.map((v) => v.toJson()).toList(); }*/ map['coverImage'] = _coverImage; map['isLiked'] = _isLiked; map['isFavorite'] = _isFavorite; map['viewCount'] = _viewCount; map['createTime'] = _createTime; map['author'] = _author; map['shareUrl'] = _shareUrl; map['shareDesc'] = _shareDesc; return map; } }