| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- class VideoNewModel {
- VideoNewModel({
- String? contentId,
- String? url,
- String? title,
- int? likeCount,
- int? commentCount,
- int? favoriteCount,
- int? shareCount,
- //List<dynamic>? 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<dynamic>? _commentList;
- String? _coverImage;
- String? _author;
- String? _shareUrl;
- String? _shareDesc;
- VideoNewModel copyWith({
- String? contentId,
- String? url,
- String? title,
- int? likeCount,
- int? commentCount,
- int? favoriteCount,
- // List<Comment>? 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<dynamic>? get commentList => _commentList;
- String? get coverImage => _coverImage;
- String? get author => _author;
- String? get shareUrl=> _shareUrl;
- String? get shareDesc=> _shareDesc;
- Map<String, dynamic> toJson() {
- final map = <String, dynamic>{};
- 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;
- }
- }
|