123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758 |
- import 'package:equatable/equatable.dart';
- import 'package:json_annotation/json_annotation.dart';
- part 'selection_model.g.dart';
- @JsonSerializable()
- class SelectionModel extends Equatable {
- @JsonKey(name: 'itemList')
- final List<Selection> selectionList;
- @JsonKey(name: 'count')
- final int count;
- @JsonKey(name: 'total')
- final int total;
- @JsonKey(name: 'nextPageUrl')
- final String nextPageUrl;
- @JsonKey(name: 'adExist')
- final bool adExist;
- SelectionModel(this.selectionList, this.count, this.total, this.nextPageUrl,
- this.adExist);
- factory SelectionModel.fromJson(Map<String, dynamic> srcJson) =>
- _$SelectionModelFromJson(srcJson);
- Map<String, dynamic> toJson() => _$SelectionModelToJson(this);
- @override
- List<Object> get props => [selectionList, count, total, nextPageUrl, adExist];
- }
- @JsonSerializable()
- class Selection extends Equatable {
- @JsonKey(name: 'type')
- final String type;
- @JsonKey(name: 'data')
- final SelectionData data;
- @JsonKey(name: 'tag')
- final String tag;
- @JsonKey(name: 'id')
- final int id;
- @JsonKey(name: 'adIndex')
- final int adIndex;
- Selection(this.type, this.data, this.tag, this.id, this.adIndex);
- factory Selection.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$SelectionFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- Map<String, dynamic> toJson() => _$SelectionToJson(this);
- @override
- List<Object> get props => [type, data, tag, id, adIndex];
- }
- @JsonSerializable()
- class SelectionData extends Equatable {
- @JsonKey(name: 'dataType')
- final String dataType;
- @JsonKey(name: 'header')
- final SelectionHeader header;
- @JsonKey(name: 'itemList')
- final List<Selection> selectionList;
- @JsonKey(name: 'count')
- final int count;
- @JsonKey(name: 'addTrack')
- final List<String> addTrack;
- @JsonKey(name: 'id')
- final int id;
- @JsonKey(name: 'type')
- final String type;
- @JsonKey(name: 'text')
- final String text;
- @JsonKey(name: 'subTitle')
- final String subTitle;
- @JsonKey(name: 'actionUrl')
- final String actionUrl;
- @JsonKey(name: 'follow')
- final Follow follow;
- @JsonKey(name: 'content')
- final Selection content;
- @JsonKey(name: 'title')
- final String title;
- @JsonKey(name: 'description')
- final String description;
- @JsonKey(name: 'tags')
- final List<Tags> tags;
- @JsonKey(name: 'consumption')
- final Consumption consumption;
- @JsonKey(name: 'resourceType')
- final String resourceType;
- @JsonKey(name: 'provider')
- final Provider provider;
- @JsonKey(name: 'category')
- final String category;
- @JsonKey(name: 'author')
- final Author author;
- @JsonKey(name: 'cover')
- final Cover cover;
- @JsonKey(name: 'playUrl')
- final String playUrl;
- @JsonKey(name: 'duration')
- final int duration;
- @JsonKey(name: 'webUrl')
- final WebUrl webUrl;
- @JsonKey(name: 'releaseTime')
- final int releaseTime;
- @JsonKey(name: 'playInfo')
- final List<PlayInfo> playInfo;
- @JsonKey(name: 'date')
- final int date;
- @JsonKey(name: 'labelList')
- final List<String> labelList;
- @JsonKey(name: 'collected')
- final bool collected;
- @JsonKey(name: 'reallyCollected')
- final bool reallyCollected;
- @JsonKey(name: 'played')
- final bool played;
- @JsonKey(name: 'src')
- final int src;
- SelectionData(
- this.dataType,
- this.header,
- this.selectionList,
- this.count,
- this.addTrack,
- this.id,
- this.type,
- this.text,
- this.subTitle,
- this.actionUrl,
- this.follow,
- this.content,
- this.title,
- this.description,
- this.tags,
- this.consumption,
- this.resourceType,
- this.provider,
- this.category,
- this.author,
- this.cover,
- this.playUrl,
- this.duration,
- this.webUrl,
- this.releaseTime,
- this.playInfo,
- this.date,
- this.labelList,
- this.collected,
- this.reallyCollected,
- this.played,
- this.src);
- @override
- List<Object> get props => [
- dataType,
- header,
- selectionList,
- count,
- addTrack,
- id,
- type,
- text,
- subTitle,
- actionUrl,
- follow,
- content,
- title,
- description,
- tags,
- consumption,
- resourceType,
- provider,
- category,
- author,
- cover,
- playUrl,
- duration,
- webUrl,
- releaseTime,
- playInfo,
- date,
- labelList,
- collected,
- reallyCollected,
- played,
- src
- ];
- factory SelectionData.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$SelectionDataFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- Map<String, dynamic> toJson() => _$SelectionDataToJson(this);
- }
- @JsonSerializable()
- class SelectionHeader extends Equatable {
- @JsonKey(name: 'id')
- final int id;
- @JsonKey(name: 'title')
- final String title;
- @JsonKey(name: 'font')
- final String font;
- @JsonKey(name: 'subTitle')
- final String subTitle;
- @JsonKey(name: 'subTitleFont')
- final String subTitleFont;
- @JsonKey(name: 'textAlign')
- final String textAlign;
- @JsonKey(name: 'cover')
- final String cover;
- @JsonKey(name: 'label')
- final String label;
- @JsonKey(name: 'actionUrl')
- final String actionUrl;
- @JsonKey(name: 'labelList')
- final List<String> labelList;
- @JsonKey(name: 'rightText')
- final String rightText;
- @JsonKey(name: 'icon')
- final String icon;
- @JsonKey(name: 'iconType')
- final String iconType;
- @JsonKey(name: 'description')
- final String description;
- @JsonKey(name: 'time')
- final int time;
- @JsonKey(name: 'showHateVideo')
- final bool showHateVideo;
- const SelectionHeader(
- this.id,
- this.title,
- this.font,
- this.subTitle,
- this.subTitleFont,
- this.textAlign,
- this.cover,
- this.label,
- this.actionUrl,
- this.labelList,
- this.rightText,
- this.icon,
- this.iconType,
- this.description,
- this.time,
- this.showHateVideo,
- );
- @override
- List<Object> get props => [
- this.id,
- this.title,
- this.font,
- this.subTitle,
- this.subTitleFont,
- this.textAlign,
- this.cover,
- this.label,
- this.actionUrl,
- this.labelList,
- this.rightText,
- this.icon,
- this.iconType,
- this.description,
- this.time,
- this.showHateVideo
- ];
- factory SelectionHeader.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$SelectionHeaderFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- Map<String, dynamic> toJson() => _$SelectionHeaderToJson(this);
- }
- @JsonSerializable()
- class Tags extends Equatable {
- @JsonKey(name: 'id')
- final int id;
- @JsonKey(name: 'name')
- final String name;
- @JsonKey(name: 'actionUrl')
- final String actionUrl;
- @JsonKey(name: 'desc')
- final String desc;
- @JsonKey(name: 'bgPicture')
- final String bgPicture;
- @JsonKey(name: 'headerImage')
- final String headerImage;
- @JsonKey(name: 'tagRecType')
- final String tagRecType;
- @JsonKey(name: 'haveReward')
- final bool haveReward;
- @JsonKey(name: 'ifNewest')
- final bool ifNewest;
- @JsonKey(name: 'communityIndex')
- final int communityIndex;
- Tags(
- this.id,
- this.name,
- this.actionUrl,
- this.desc,
- this.bgPicture,
- this.headerImage,
- this.tagRecType,
- this.haveReward,
- this.ifNewest,
- this.communityIndex,
- );
- factory Tags.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$TagsFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- @override
- List<Object> get props => [
- id,
- name,
- actionUrl,
- desc,
- bgPicture,
- headerImage,
- tagRecType,
- haveReward,
- ifNewest,
- communityIndex,
- ];
- }
- @JsonSerializable()
- class Consumption extends Equatable {
- @JsonKey(name: 'collectionCount')
- final int collectionCount;
- @JsonKey(name: 'shareCount')
- final int shareCount;
- @JsonKey(name: 'replyCount')
- final int replyCount;
- @JsonKey(name: 'realCollectionCount')
- final int realCollectionCount;
- Consumption(
- this.collectionCount,
- this.shareCount,
- this.replyCount,
- this.realCollectionCount,
- );
- factory Consumption.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$ConsumptionFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- @override
- List<Object> get props => [
- collectionCount,
- shareCount,
- replyCount,
- realCollectionCount,
- ];
- }
- @JsonSerializable()
- class Provider extends Equatable {
- @JsonKey(name: 'name')
- final String name;
- @JsonKey(name: 'alias')
- final String alias;
- @JsonKey(name: 'icon')
- final String icon;
- Provider(
- this.name,
- this.alias,
- this.icon,
- );
- factory Provider.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$ProviderFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- @override
- List<Object> get props => [
- name,
- alias,
- icon,
- ];
- }
- @JsonSerializable()
- class Author extends Equatable {
- @JsonKey(name: 'id')
- final int id;
- @JsonKey(name: 'icon')
- final String icon;
- @JsonKey(name: 'name')
- final String name;
- @JsonKey(name: 'description')
- final String description;
- @JsonKey(name: 'link')
- final String link;
- @JsonKey(name: 'latestReleaseTime')
- final int latestReleaseTime;
- @JsonKey(name: 'videoNum')
- final int videoNum;
- @JsonKey(name: 'follow')
- final Follow follow;
- @JsonKey(name: 'shield')
- final Shield shield;
- @JsonKey(name: 'approvedNotReadyVideoCount')
- final int approvedNotReadyVideoCount;
- @JsonKey(name: 'ifPgc')
- final bool ifPgc;
- @JsonKey(name: 'recSort')
- final int recSort;
- @JsonKey(name: 'expert')
- final bool expert;
- Author(
- this.id,
- this.icon,
- this.name,
- this.description,
- this.link,
- this.latestReleaseTime,
- this.videoNum,
- this.follow,
- this.shield,
- this.approvedNotReadyVideoCount,
- this.ifPgc,
- this.recSort,
- this.expert,
- );
- factory Author.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$AuthorFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- @override
- List<Object> get props => [
- id,
- icon,
- name,
- description,
- link,
- latestReleaseTime,
- videoNum,
- follow,
- shield,
- approvedNotReadyVideoCount,
- ifPgc,
- recSort,
- expert,
- ];
- }
- @JsonSerializable()
- class Follow extends Equatable {
- @JsonKey(name: 'itemType')
- final String itemType;
- @JsonKey(name: 'itemId')
- final int itemId;
- @JsonKey(name: 'followed')
- final bool followed;
- Follow(
- this.itemType,
- this.itemId,
- this.followed,
- );
- factory Follow.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$FollowFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- @override
- List<Object> get props => [
- itemType,
- itemId,
- followed,
- ];
- }
- @JsonSerializable()
- class Shield extends Equatable {
- @JsonKey(name: 'itemType')
- final String itemType;
- @JsonKey(name: 'itemId')
- final int itemId;
- @JsonKey(name: 'shielded')
- final bool shielded;
- Shield(
- this.itemType,
- this.itemId,
- this.shielded,
- );
- factory Shield.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$ShieldFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- @override
- List<Object> get props => [itemType, itemId, shielded];
- }
- @JsonSerializable()
- class Cover extends Equatable {
- @JsonKey(name: 'feed')
- final String feed;
- @JsonKey(name: 'detail')
- final String detail;
- @JsonKey(name: 'blurred')
- final String blurred;
- @JsonKey(name: 'homepage')
- final String homepage;
- Cover(
- this.feed,
- this.detail,
- this.blurred,
- this.homepage,
- );
- factory Cover.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$CoverFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- @override
- List<Object> get props => [
- feed,
- detail,
- blurred,
- homepage,
- ];
- }
- @JsonSerializable()
- class WebUrl extends Equatable {
- @JsonKey(name: 'raw')
- final String raw;
- @JsonKey(name: 'forWeibo')
- final String forWeibo;
- WebUrl(
- this.raw,
- this.forWeibo,
- );
- factory WebUrl.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$WebUrlFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- @override
- List<Object> get props => [raw, forWeibo];
- }
- @JsonSerializable()
- class PlayInfo extends Equatable {
- @JsonKey(name: 'height')
- final int height;
- @JsonKey(name: 'width')
- final int width;
- @JsonKey(name: 'urlList')
- final List<UrlList> urlList;
- @JsonKey(name: 'name')
- final String name;
- @JsonKey(name: 'type')
- final String type;
- @JsonKey(name: 'url')
- final String url;
- PlayInfo(
- this.height,
- this.width,
- this.urlList,
- this.name,
- this.type,
- this.url,
- );
- factory PlayInfo.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$PlayInfoFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- @override
- List<Object> get props => [
- height,
- width,
- urlList,
- name,
- type,
- url,
- ];
- }
- @JsonSerializable()
- class UrlList extends Equatable {
- @JsonKey(name: 'name')
- final String name;
- @JsonKey(name: 'url')
- final String url;
- @JsonKey(name: 'size')
- final int size;
- UrlList(
- this.name,
- this.url,
- this.size,
- );
- factory UrlList.fromJson(Map<String, dynamic> srcJson) {
- try {
- return _$UrlListFromJson(srcJson);
- } catch (e) {
- print('$e');
- }
- }
- @override
- List<Object> get props => [
- name,
- url,
- size,
- ];
- }
|