From 1d4eabb770ae5cb31b8fe4dea571c8803d8d8be4 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sat, 17 May 2025 18:08:55 +0800 Subject: [PATCH] tweak Signed-off-by: bggRGjQaUbCoE --- lib/models/bangumi/pgc_timeline/result.dart | 56 ++++----- .../dynamics/article_opus/attributes.dart | 9 ++ lib/models/dynamics/article_opus/opus.dart | 92 ++++++++++++++ .../dynamics/dyn_topic_feed/all_sort_by.dart | 22 ++-- .../dynamics/dyn_topic_top/topic_item.dart | 116 +++++++++--------- lib/models/live/live_emoticons/top_left.dart | 22 ++-- lib/models/live/live_emoticons/top_right.dart | 22 ++-- lib/models/live/live_emoticons/top_show.dart | 30 ++--- .../live/live_emoticons/top_show_recent.dart | 30 ++--- .../live/live_feed_index/module_info.dart | 68 +++++----- lib/models/space/achieve.dart | 20 +-- lib/models/space/article.dart | 20 +-- lib/models/space/attention_tip.dart | 16 +-- lib/models/space/audios.dart | 14 +-- lib/models/space/avatar.dart | 20 +-- lib/models/space/color_config.dart | 18 +-- lib/models/space/colour.dart | 14 +-- lib/models/space/container_size.dart | 14 +-- lib/models/space/day.dart | 8 +- lib/models/space/digital_info.dart | 74 +++++------ lib/models/space/draw.dart | 18 +-- lib/models/space/draw_src.dart | 16 +-- lib/models/space/entrance.dart | 20 +-- lib/models/space/entrance_button.dart | 14 +-- lib/models/space/episodic_button.dart | 14 +-- lib/models/space/fallback_layers.dart | 16 +-- lib/models/space/general_spec.dart | 22 ++-- lib/models/space/honours.dart | 14 +-- lib/models/space/layer.dart | 18 +-- lib/models/space/level_info.dart | 46 +++---- lib/models/space/nameplate.dart | 38 +++--- lib/models/space/nft_certificate.dart | 14 +-- lib/models/space/night.dart | 8 +- lib/models/space/order.dart | 10 +- lib/models/space/pos_spec.dart | 22 ++-- lib/models/space/profession_verify.dart | 16 +-- lib/models/space/purchase_button.dart | 14 +-- lib/models/space/render_spec.dart | 12 +- lib/models/space/res_native_draw.dart | 14 +-- lib/models/space/resource.dart | 18 +-- lib/models/space/senior_inquiry.dart | 18 +-- lib/models/space/series.dart | 12 +- lib/models/space/setting.dart | 116 +++++++++--------- lib/models/space/size_spec.dart | 14 +-- lib/models/space_archive/badge.dart | 54 ++++---- lib/models/space_archive/cursor_attr.dart | 16 +-- lib/models/space_archive/episodic_button.dart | 14 +-- .../space_archive/last_watched_locator.dart | 28 ++--- lib/models/space_archive/order.dart | 10 +- lib/models/space_article/category.dart | 18 +-- lib/models/space_article/item.dart | 12 +- lib/models/space_article/label.dart | 14 +-- lib/models/space_article/media.dart | 46 +++---- lib/models/space_article/nameplate.dart | 38 +++--- lib/models/space_opus/stat.dart | 16 +-- lib/pages/article/view.dart | 5 + lib/pages/article/widgets/read_opus.dart | 77 ++++++++++++ lib/pages/dynamics/view.dart | 2 +- 58 files changed, 875 insertions(+), 684 deletions(-) create mode 100644 lib/models/dynamics/article_opus/attributes.dart create mode 100644 lib/models/dynamics/article_opus/opus.dart create mode 100644 lib/pages/article/widgets/read_opus.dart diff --git a/lib/models/bangumi/pgc_timeline/result.dart b/lib/models/bangumi/pgc_timeline/result.dart index 76e0314e..872b8b75 100644 --- a/lib/models/bangumi/pgc_timeline/result.dart +++ b/lib/models/bangumi/pgc_timeline/result.dart @@ -1,35 +1,35 @@ import 'package:PiliPlus/models/bangumi/pgc_timeline/episode.dart'; class Result { - String? date; - int? dateTs; - int? dayOfWeek; - List? episodes; - int? isToday; + String? date; + int? dateTs; + int? dayOfWeek; + List? episodes; + int? isToday; - Result({ - this.date, - this.dateTs, - this.dayOfWeek, - this.episodes, - this.isToday, - }); + Result({ + this.date, + this.dateTs, + this.dayOfWeek, + this.episodes, + this.isToday, + }); - factory Result.fromJson(Map json) => Result( - date: json['date'] as String?, - dateTs: json['date_ts'] as int?, - dayOfWeek: json['day_of_week'] as int?, - episodes: (json['episodes'] as List?) - ?.map((e) => Episode.fromJson(e as Map)) - .toList(), - isToday: json['is_today'] as int?, - ); + factory Result.fromJson(Map json) => Result( + date: json['date'] as String?, + dateTs: json['date_ts'] as int?, + dayOfWeek: json['day_of_week'] as int?, + episodes: (json['episodes'] as List?) + ?.map((e) => Episode.fromJson(e as Map)) + .toList(), + isToday: json['is_today'] as int?, + ); - Map toJson() => { - 'date': date, - 'date_ts': dateTs, - 'day_of_week': dayOfWeek, - 'episodes': episodes?.map((e) => e.toJson()).toList(), - 'is_today': isToday, - }; + Map toJson() => { + 'date': date, + 'date_ts': dateTs, + 'day_of_week': dayOfWeek, + 'episodes': episodes?.map((e) => e.toJson()).toList(), + 'is_today': isToday, + }; } diff --git a/lib/models/dynamics/article_opus/attributes.dart b/lib/models/dynamics/article_opus/attributes.dart new file mode 100644 index 00000000..6909675f --- /dev/null +++ b/lib/models/dynamics/article_opus/attributes.dart @@ -0,0 +1,9 @@ +class Attributes { + String? clazz; + + Attributes({this.clazz}); + + factory Attributes.fromJson(Map json) => Attributes( + clazz: json['class'] as String?, + ); +} diff --git a/lib/models/dynamics/article_opus/opus.dart b/lib/models/dynamics/article_opus/opus.dart new file mode 100644 index 00000000..28ca714a --- /dev/null +++ b/lib/models/dynamics/article_opus/opus.dart @@ -0,0 +1,92 @@ +import 'package:PiliPlus/models/dynamics/article_opus/attributes.dart'; + +class ReadOpusModel { + dynamic insert; + Attributes? attributes; + + ReadOpusModel({this.insert, this.attributes}); + + ReadOpusModel.fromJson(Map json) { + if (json['insert'] is Map) { + insert = Insert.fromJson(json['insert']); + } else { + insert = json['insert']; + } + attributes = json['attributes'] == null + ? null + : Attributes.fromJson(json['attributes'] as Map); + } +} + +class Insert { + InsertCard? card; + + Insert({ + this.card, + }); + + Insert.fromJson(Map json) { + if (json['article-card'] != null) { + card = InsertCard.fromJson(json['article-card']); + return; + } + + if (json['live-card'] != null) { + card = InsertCard.fromJson(json['live-card']); + return; + } + + if (json['goods-card'] != null) { + card = InsertCard.fromJson(json['goods-card']); + return; + } + + if (json['video-card'] != null) { + card = InsertCard.fromJson(json['video-card']); + return; + } + + if (json['mall-card'] != null) { + card = InsertCard.fromJson(json['mall-card']); + return; + } + + if (json['vote-card'] != null) { + card = InsertCard.fromJson(json['vote-card']); + return; + } + } +} + +class InsertCard { + dynamic tid; + String? id; + dynamic alt; + String? url; + num? width; + num? height; + num? size; + String? status; + + InsertCard({ + this.tid, + this.id, + this.alt, + this.url, + this.width, + this.height, + this.size, + this.status, + }); + + InsertCard.fromJson(Map json) { + tid = json['tid']; + id = json['id'] == '' ? null : json['id']; + alt = json['alt']; + url = json['url']; + width = json['width']; + height = json['height']; + size = json['size']; + status = json['status']; + } +} diff --git a/lib/models/dynamics/dyn_topic_feed/all_sort_by.dart b/lib/models/dynamics/dyn_topic_feed/all_sort_by.dart index f23046b7..8ea89c45 100644 --- a/lib/models/dynamics/dyn_topic_feed/all_sort_by.dart +++ b/lib/models/dynamics/dyn_topic_feed/all_sort_by.dart @@ -1,16 +1,16 @@ class AllSortBy { - int? sortBy; - String? sortName; + int? sortBy; + String? sortName; - AllSortBy({this.sortBy, this.sortName}); + AllSortBy({this.sortBy, this.sortName}); - factory AllSortBy.fromJson(Map json) => AllSortBy( - sortBy: json['sort_by'] as int?, - sortName: json['sort_name'] as String?, - ); + factory AllSortBy.fromJson(Map json) => AllSortBy( + sortBy: json['sort_by'] as int?, + sortName: json['sort_name'] as String?, + ); - Map toJson() => { - 'sort_by': sortBy, - 'sort_name': sortName, - }; + Map toJson() => { + 'sort_by': sortBy, + 'sort_name': sortName, + }; } diff --git a/lib/models/dynamics/dyn_topic_top/topic_item.dart b/lib/models/dynamics/dyn_topic_top/topic_item.dart index bfc0651c..ea04fea3 100644 --- a/lib/models/dynamics/dyn_topic_top/topic_item.dart +++ b/lib/models/dynamics/dyn_topic_top/topic_item.dart @@ -1,63 +1,63 @@ class TopicItem { - int? id; - String? name; - int? view; - int? discuss; - int? fav; - int? dynamics; - String? jumpUrl; - String? backColor; - String? description; - String? sharePic; - String? shareUrl; - int? ctime; - bool? showInteractData; + int? id; + String? name; + int? view; + int? discuss; + int? fav; + int? dynamics; + String? jumpUrl; + String? backColor; + String? description; + String? sharePic; + String? shareUrl; + int? ctime; + bool? showInteractData; - TopicItem({ - this.id, - this.name, - this.view, - this.discuss, - this.fav, - this.dynamics, - this.jumpUrl, - this.backColor, - this.description, - this.sharePic, - this.shareUrl, - this.ctime, - this.showInteractData, - }); + TopicItem({ + this.id, + this.name, + this.view, + this.discuss, + this.fav, + this.dynamics, + this.jumpUrl, + this.backColor, + this.description, + this.sharePic, + this.shareUrl, + this.ctime, + this.showInteractData, + }); - factory TopicItem.fromJson(Map json) => TopicItem( - id: json['id'] as int?, - name: json['name'] as String?, - view: json['view'] as int?, - discuss: json['discuss'] as int?, - fav: json['fav'] as int?, - dynamics: json['dynamics'] as int?, - jumpUrl: json['jump_url'] as String?, - backColor: json['back_color'] as String?, - description: json['description'] as String?, - sharePic: json['share_pic'] as String?, - shareUrl: json['share_url'] as String?, - ctime: json['ctime'] as int?, - showInteractData: json['show_interact_data'] as bool?, - ); + factory TopicItem.fromJson(Map json) => TopicItem( + id: json['id'] as int?, + name: json['name'] as String?, + view: json['view'] as int?, + discuss: json['discuss'] as int?, + fav: json['fav'] as int?, + dynamics: json['dynamics'] as int?, + jumpUrl: json['jump_url'] as String?, + backColor: json['back_color'] as String?, + description: json['description'] as String?, + sharePic: json['share_pic'] as String?, + shareUrl: json['share_url'] as String?, + ctime: json['ctime'] as int?, + showInteractData: json['show_interact_data'] as bool?, + ); - Map toJson() => { - 'id': id, - 'name': name, - 'view': view, - 'discuss': discuss, - 'fav': fav, - 'dynamics': dynamics, - 'jump_url': jumpUrl, - 'back_color': backColor, - 'description': description, - 'share_pic': sharePic, - 'share_url': shareUrl, - 'ctime': ctime, - 'show_interact_data': showInteractData, - }; + Map toJson() => { + 'id': id, + 'name': name, + 'view': view, + 'discuss': discuss, + 'fav': fav, + 'dynamics': dynamics, + 'jump_url': jumpUrl, + 'back_color': backColor, + 'description': description, + 'share_pic': sharePic, + 'share_url': shareUrl, + 'ctime': ctime, + 'show_interact_data': showInteractData, + }; } diff --git a/lib/models/live/live_emoticons/top_left.dart b/lib/models/live/live_emoticons/top_left.dart index 60b54478..f9fe3202 100644 --- a/lib/models/live/live_emoticons/top_left.dart +++ b/lib/models/live/live_emoticons/top_left.dart @@ -1,16 +1,16 @@ class TopLeft { - String? image; - String? text; + String? image; + String? text; - TopLeft({this.image, this.text}); + TopLeft({this.image, this.text}); - factory TopLeft.fromJson(Map json) => TopLeft( - image: json['image'] as String?, - text: json['text'] as String?, - ); + factory TopLeft.fromJson(Map json) => TopLeft( + image: json['image'] as String?, + text: json['text'] as String?, + ); - Map toJson() => { - 'image': image, - 'text': text, - }; + Map toJson() => { + 'image': image, + 'text': text, + }; } diff --git a/lib/models/live/live_emoticons/top_right.dart b/lib/models/live/live_emoticons/top_right.dart index 0c2249af..088d55a3 100644 --- a/lib/models/live/live_emoticons/top_right.dart +++ b/lib/models/live/live_emoticons/top_right.dart @@ -1,16 +1,16 @@ class TopRight { - String? image; - String? text; + String? image; + String? text; - TopRight({this.image, this.text}); + TopRight({this.image, this.text}); - factory TopRight.fromJson(Map json) => TopRight( - image: json['image'] as String?, - text: json['text'] as String?, - ); + factory TopRight.fromJson(Map json) => TopRight( + image: json['image'] as String?, + text: json['text'] as String?, + ); - Map toJson() => { - 'image': image, - 'text': text, - }; + Map toJson() => { + 'image': image, + 'text': text, + }; } diff --git a/lib/models/live/live_emoticons/top_show.dart b/lib/models/live/live_emoticons/top_show.dart index 1cf6ad43..15ce0b6f 100644 --- a/lib/models/live/live_emoticons/top_show.dart +++ b/lib/models/live/live_emoticons/top_show.dart @@ -2,22 +2,22 @@ import 'package:PiliPlus/models/live/live_emoticons/top_left.dart'; import 'package:PiliPlus/models/live/live_emoticons/top_right.dart'; class TopShow { - TopLeft? topLeft; - TopRight? topRight; + TopLeft? topLeft; + TopRight? topRight; - TopShow({this.topLeft, this.topRight}); + TopShow({this.topLeft, this.topRight}); - factory TopShow.fromJson(Map json) => TopShow( - topLeft: json['top_left'] == null - ? null - : TopLeft.fromJson(json['top_left'] as Map), - topRight: json['top_right'] == null - ? null - : TopRight.fromJson(json['top_right'] as Map), - ); + factory TopShow.fromJson(Map json) => TopShow( + topLeft: json['top_left'] == null + ? null + : TopLeft.fromJson(json['top_left'] as Map), + topRight: json['top_right'] == null + ? null + : TopRight.fromJson(json['top_right'] as Map), + ); - Map toJson() => { - 'top_left': topLeft?.toJson(), - 'top_right': topRight?.toJson(), - }; + Map toJson() => { + 'top_left': topLeft?.toJson(), + 'top_right': topRight?.toJson(), + }; } diff --git a/lib/models/live/live_emoticons/top_show_recent.dart b/lib/models/live/live_emoticons/top_show_recent.dart index 09869c33..7d4917a9 100644 --- a/lib/models/live/live_emoticons/top_show_recent.dart +++ b/lib/models/live/live_emoticons/top_show_recent.dart @@ -2,22 +2,22 @@ import 'package:PiliPlus/models/live/live_emoticons/top_left.dart'; import 'package:PiliPlus/models/live/live_emoticons/top_right.dart'; class TopShowRecent { - TopLeft? topLeft; - TopRight? topRight; + TopLeft? topLeft; + TopRight? topRight; - TopShowRecent({this.topLeft, this.topRight}); + TopShowRecent({this.topLeft, this.topRight}); - factory TopShowRecent.fromJson(Map json) => TopShowRecent( - topLeft: json['top_left'] == null - ? null - : TopLeft.fromJson(json['top_left'] as Map), - topRight: json['top_right'] == null - ? null - : TopRight.fromJson(json['top_right'] as Map), - ); + factory TopShowRecent.fromJson(Map json) => TopShowRecent( + topLeft: json['top_left'] == null + ? null + : TopLeft.fromJson(json['top_left'] as Map), + topRight: json['top_right'] == null + ? null + : TopRight.fromJson(json['top_right'] as Map), + ); - Map toJson() => { - 'top_left': topLeft?.toJson(), - 'top_right': topRight?.toJson(), - }; + Map toJson() => { + 'top_left': topLeft?.toJson(), + 'top_right': topRight?.toJson(), + }; } diff --git a/lib/models/live/live_feed_index/module_info.dart b/lib/models/live/live_feed_index/module_info.dart index fa151bed..c1f62a9a 100644 --- a/lib/models/live/live_feed_index/module_info.dart +++ b/lib/models/live/live_feed_index/module_info.dart @@ -1,39 +1,39 @@ class ModuleInfo { - int? id; - String? link; - String? pic; - String? title; - int? type; - int? sort; - int? count; + int? id; + String? link; + String? pic; + String? title; + int? type; + int? sort; + int? count; - ModuleInfo({ - this.id, - this.link, - this.pic, - this.title, - this.type, - this.sort, - this.count, - }); + ModuleInfo({ + this.id, + this.link, + this.pic, + this.title, + this.type, + this.sort, + this.count, + }); - factory ModuleInfo.fromJson(Map json) => ModuleInfo( - id: json['id'] as int?, - link: json['link'] as String?, - pic: json['pic'] as String?, - title: json['title'] as String?, - type: json['type'] as int?, - sort: json['sort'] as int?, - count: json['count'] as int?, - ); + factory ModuleInfo.fromJson(Map json) => ModuleInfo( + id: json['id'] as int?, + link: json['link'] as String?, + pic: json['pic'] as String?, + title: json['title'] as String?, + type: json['type'] as int?, + sort: json['sort'] as int?, + count: json['count'] as int?, + ); - Map toJson() => { - 'id': id, - 'link': link, - 'pic': pic, - 'title': title, - 'type': type, - 'sort': sort, - 'count': count, - }; + Map toJson() => { + 'id': id, + 'link': link, + 'pic': pic, + 'title': title, + 'type': type, + 'sort': sort, + 'count': count, + }; } diff --git a/lib/models/space/achieve.dart b/lib/models/space/achieve.dart index ac310b6d..67dad4cc 100644 --- a/lib/models/space/achieve.dart +++ b/lib/models/space/achieve.dart @@ -4,17 +4,17 @@ part 'achieve.g.dart'; @JsonSerializable() class Achieve { - @JsonKey(name: 'is_default') - bool? isDefault; - String? image; - @JsonKey(name: 'achieve_url') - String? achieveUrl; + @JsonKey(name: 'is_default') + bool? isDefault; + String? image; + @JsonKey(name: 'achieve_url') + String? achieveUrl; - Achieve({this.isDefault, this.image, this.achieveUrl}); + Achieve({this.isDefault, this.image, this.achieveUrl}); - factory Achieve.fromJson(Map json) { - return _$AchieveFromJson(json); - } + factory Achieve.fromJson(Map json) { + return _$AchieveFromJson(json); + } - Map toJson() => _$AchieveToJson(this); + Map toJson() => _$AchieveToJson(this); } diff --git a/lib/models/space/article.dart b/lib/models/space/article.dart index 415a0f3a..0018ab1d 100644 --- a/lib/models/space/article.dart +++ b/lib/models/space/article.dart @@ -4,17 +4,17 @@ part 'article.g.dart'; @JsonSerializable() class Article { - int? count; - List? item; - @JsonKey(name: 'lists_count') - int? listsCount; - List? lists; + int? count; + List? item; + @JsonKey(name: 'lists_count') + int? listsCount; + List? lists; - Article({this.count, this.item, this.listsCount, this.lists}); + Article({this.count, this.item, this.listsCount, this.lists}); - factory Article.fromJson(Map json) { - return _$ArticleFromJson(json); - } + factory Article.fromJson(Map json) { + return _$ArticleFromJson(json); + } - Map toJson() => _$ArticleToJson(this); + Map toJson() => _$ArticleToJson(this); } diff --git a/lib/models/space/attention_tip.dart b/lib/models/space/attention_tip.dart index 999e4b53..62ed265b 100644 --- a/lib/models/space/attention_tip.dart +++ b/lib/models/space/attention_tip.dart @@ -4,15 +4,15 @@ part 'attention_tip.g.dart'; @JsonSerializable() class AttentionTip { - @JsonKey(name: 'card_num') - int? cardNum; - String? tip; + @JsonKey(name: 'card_num') + int? cardNum; + String? tip; - AttentionTip({this.cardNum, this.tip}); + AttentionTip({this.cardNum, this.tip}); - factory AttentionTip.fromJson(Map json) { - return _$AttentionTipFromJson(json); - } + factory AttentionTip.fromJson(Map json) { + return _$AttentionTipFromJson(json); + } - Map toJson() => _$AttentionTipToJson(this); + Map toJson() => _$AttentionTipToJson(this); } diff --git a/lib/models/space/audios.dart b/lib/models/space/audios.dart index 9c19ee8d..f46a3f07 100644 --- a/lib/models/space/audios.dart +++ b/lib/models/space/audios.dart @@ -4,14 +4,14 @@ part 'audios.g.dart'; @JsonSerializable() class Audios { - int? count; - List? item; + int? count; + List? item; - Audios({this.count, this.item}); + Audios({this.count, this.item}); - factory Audios.fromJson(Map json) { - return _$AudiosFromJson(json); - } + factory Audios.fromJson(Map json) { + return _$AudiosFromJson(json); + } - Map toJson() => _$AudiosToJson(this); + Map toJson() => _$AudiosToJson(this); } diff --git a/lib/models/space/avatar.dart b/lib/models/space/avatar.dart index 526375f7..b516a718 100644 --- a/lib/models/space/avatar.dart +++ b/lib/models/space/avatar.dart @@ -7,17 +7,17 @@ part 'avatar.g.dart'; @JsonSerializable() class Avatar { - @JsonKey(name: 'container_size') - ContainerSize? containerSize; - @JsonKey(name: 'fallback_layers') - FallbackLayers? fallbackLayers; - String? mid; + @JsonKey(name: 'container_size') + ContainerSize? containerSize; + @JsonKey(name: 'fallback_layers') + FallbackLayers? fallbackLayers; + String? mid; - Avatar({this.containerSize, this.fallbackLayers, this.mid}); + Avatar({this.containerSize, this.fallbackLayers, this.mid}); - factory Avatar.fromJson(Map json) { - return _$AvatarFromJson(json); - } + factory Avatar.fromJson(Map json) { + return _$AvatarFromJson(json); + } - Map toJson() => _$AvatarToJson(this); + Map toJson() => _$AvatarToJson(this); } diff --git a/lib/models/space/color_config.dart b/lib/models/space/color_config.dart index 2bd9883c..adf73e98 100644 --- a/lib/models/space/color_config.dart +++ b/lib/models/space/color_config.dart @@ -7,16 +7,16 @@ part 'color_config.g.dart'; @JsonSerializable() class ColorConfig { - @JsonKey(name: 'is_dark_mode_aware') - bool? isDarkModeAware; - Day? day; - Night? night; + @JsonKey(name: 'is_dark_mode_aware') + bool? isDarkModeAware; + Day? day; + Night? night; - ColorConfig({this.isDarkModeAware, this.day, this.night}); + ColorConfig({this.isDarkModeAware, this.day, this.night}); - factory ColorConfig.fromJson(Map json) { - return _$ColorConfigFromJson(json); - } + factory ColorConfig.fromJson(Map json) { + return _$ColorConfigFromJson(json); + } - Map toJson() => _$ColorConfigToJson(this); + Map toJson() => _$ColorConfigToJson(this); } diff --git a/lib/models/space/colour.dart b/lib/models/space/colour.dart index 46cc9bd2..51ced593 100644 --- a/lib/models/space/colour.dart +++ b/lib/models/space/colour.dart @@ -4,14 +4,14 @@ part 'colour.g.dart'; @JsonSerializable() class Colour { - String? dark; - String? normal; + String? dark; + String? normal; - Colour({this.dark, this.normal}); + Colour({this.dark, this.normal}); - factory Colour.fromJson(Map json) { - return _$ColourFromJson(json); - } + factory Colour.fromJson(Map json) { + return _$ColourFromJson(json); + } - Map toJson() => _$ColourToJson(this); + Map toJson() => _$ColourToJson(this); } diff --git a/lib/models/space/container_size.dart b/lib/models/space/container_size.dart index 4b2ff79f..4142ac79 100644 --- a/lib/models/space/container_size.dart +++ b/lib/models/space/container_size.dart @@ -4,14 +4,14 @@ part 'container_size.g.dart'; @JsonSerializable() class ContainerSize { - double? width; - double? height; + double? width; + double? height; - ContainerSize({this.width, this.height}); + ContainerSize({this.width, this.height}); - factory ContainerSize.fromJson(Map json) { - return _$ContainerSizeFromJson(json); - } + factory ContainerSize.fromJson(Map json) { + return _$ContainerSizeFromJson(json); + } - Map toJson() => _$ContainerSizeToJson(this); + Map toJson() => _$ContainerSizeToJson(this); } diff --git a/lib/models/space/day.dart b/lib/models/space/day.dart index 765dffe7..c06893af 100644 --- a/lib/models/space/day.dart +++ b/lib/models/space/day.dart @@ -4,11 +4,11 @@ part 'day.g.dart'; @JsonSerializable() class Day { - String? argb; + String? argb; - Day({this.argb}); + Day({this.argb}); - factory Day.fromJson(Map json) => _$DayFromJson(json); + factory Day.fromJson(Map json) => _$DayFromJson(json); - Map toJson() => _$DayToJson(this); + Map toJson() => _$DayToJson(this); } diff --git a/lib/models/space/digital_info.dart b/lib/models/space/digital_info.dart index b8e5cf16..4de6e8c5 100644 --- a/lib/models/space/digital_info.dart +++ b/lib/models/space/digital_info.dart @@ -4,44 +4,44 @@ part 'digital_info.g.dart'; @JsonSerializable() class DigitalInfo { - bool? active; - @JsonKey(name: 'nft_type') - int? nftType; - @JsonKey(name: 'background_handle') - int? backgroundHandle; - @JsonKey(name: 'animation_first_frame') - String? animationFirstFrame; - @JsonKey(name: 'music_album') - dynamic musicAlbum; - dynamic animation; - @JsonKey(name: 'nft_region_title') - String? nftRegionTitle; - @JsonKey(name: 'card_id') - int? cardId; - @JsonKey(name: 'cut_space_bg') - String? cutSpaceBg; - @JsonKey(name: 'part_type') - int? partType; - @JsonKey(name: 'item_jump_url') - String? itemJumpUrl; + bool? active; + @JsonKey(name: 'nft_type') + int? nftType; + @JsonKey(name: 'background_handle') + int? backgroundHandle; + @JsonKey(name: 'animation_first_frame') + String? animationFirstFrame; + @JsonKey(name: 'music_album') + dynamic musicAlbum; + dynamic animation; + @JsonKey(name: 'nft_region_title') + String? nftRegionTitle; + @JsonKey(name: 'card_id') + int? cardId; + @JsonKey(name: 'cut_space_bg') + String? cutSpaceBg; + @JsonKey(name: 'part_type') + int? partType; + @JsonKey(name: 'item_jump_url') + String? itemJumpUrl; - DigitalInfo({ - this.active, - this.nftType, - this.backgroundHandle, - this.animationFirstFrame, - this.musicAlbum, - this.animation, - this.nftRegionTitle, - this.cardId, - this.cutSpaceBg, - this.partType, - this.itemJumpUrl, - }); + DigitalInfo({ + this.active, + this.nftType, + this.backgroundHandle, + this.animationFirstFrame, + this.musicAlbum, + this.animation, + this.nftRegionTitle, + this.cardId, + this.cutSpaceBg, + this.partType, + this.itemJumpUrl, + }); - factory DigitalInfo.fromJson(Map json) { - return _$DigitalInfoFromJson(json); - } + factory DigitalInfo.fromJson(Map json) { + return _$DigitalInfoFromJson(json); + } - Map toJson() => _$DigitalInfoToJson(this); + Map toJson() => _$DigitalInfoToJson(this); } diff --git a/lib/models/space/draw.dart b/lib/models/space/draw.dart index d68fa6a9..dabf928a 100644 --- a/lib/models/space/draw.dart +++ b/lib/models/space/draw.dart @@ -6,16 +6,16 @@ part 'draw.g.dart'; @JsonSerializable() class Draw { - @JsonKey(name: 'draw_type') - int? drawType; - @JsonKey(name: 'fill_mode') - int? fillMode; - @JsonKey(name: 'color_config') - ColorConfig? colorConfig; + @JsonKey(name: 'draw_type') + int? drawType; + @JsonKey(name: 'fill_mode') + int? fillMode; + @JsonKey(name: 'color_config') + ColorConfig? colorConfig; - Draw({this.drawType, this.fillMode, this.colorConfig}); + Draw({this.drawType, this.fillMode, this.colorConfig}); - factory Draw.fromJson(Map json) => _$DrawFromJson(json); + factory Draw.fromJson(Map json) => _$DrawFromJson(json); - Map toJson() => _$DrawToJson(this); + Map toJson() => _$DrawToJson(this); } diff --git a/lib/models/space/draw_src.dart b/lib/models/space/draw_src.dart index 01d88383..ab45a61c 100644 --- a/lib/models/space/draw_src.dart +++ b/lib/models/space/draw_src.dart @@ -6,15 +6,15 @@ part 'draw_src.g.dart'; @JsonSerializable() class DrawSrc { - @JsonKey(name: 'src_type') - int? srcType; - Draw? draw; + @JsonKey(name: 'src_type') + int? srcType; + Draw? draw; - DrawSrc({this.srcType, this.draw}); + DrawSrc({this.srcType, this.draw}); - factory DrawSrc.fromJson(Map json) { - return _$DrawSrcFromJson(json); - } + factory DrawSrc.fromJson(Map json) { + return _$DrawSrcFromJson(json); + } - Map toJson() => _$DrawSrcToJson(this); + Map toJson() => _$DrawSrcToJson(this); } diff --git a/lib/models/space/entrance.dart b/lib/models/space/entrance.dart index b1cef01b..e00691c5 100644 --- a/lib/models/space/entrance.dart +++ b/lib/models/space/entrance.dart @@ -4,17 +4,17 @@ part 'entrance.g.dart'; @JsonSerializable() class Entrance { - String? icon; - @JsonKey(name: 'jump_url') - String? jumpUrl; - @JsonKey(name: 'is_show_entrance') - bool? isShowEntrance; + String? icon; + @JsonKey(name: 'jump_url') + String? jumpUrl; + @JsonKey(name: 'is_show_entrance') + bool? isShowEntrance; - Entrance({this.icon, this.jumpUrl, this.isShowEntrance}); + Entrance({this.icon, this.jumpUrl, this.isShowEntrance}); - factory Entrance.fromJson(Map json) { - return _$EntranceFromJson(json); - } + factory Entrance.fromJson(Map json) { + return _$EntranceFromJson(json); + } - Map toJson() => _$EntranceToJson(this); + Map toJson() => _$EntranceToJson(this); } diff --git a/lib/models/space/entrance_button.dart b/lib/models/space/entrance_button.dart index 9a7096ad..b43b3a4b 100644 --- a/lib/models/space/entrance_button.dart +++ b/lib/models/space/entrance_button.dart @@ -4,14 +4,14 @@ part 'entrance_button.g.dart'; @JsonSerializable() class EntranceButton { - String? uri; - String? title; + String? uri; + String? title; - EntranceButton({this.uri, this.title}); + EntranceButton({this.uri, this.title}); - factory EntranceButton.fromJson(Map json) { - return _$EntranceButtonFromJson(json); - } + factory EntranceButton.fromJson(Map json) { + return _$EntranceButtonFromJson(json); + } - Map toJson() => _$EntranceButtonToJson(this); + Map toJson() => _$EntranceButtonToJson(this); } diff --git a/lib/models/space/episodic_button.dart b/lib/models/space/episodic_button.dart index a4523188..f5ed34b0 100644 --- a/lib/models/space/episodic_button.dart +++ b/lib/models/space/episodic_button.dart @@ -4,14 +4,14 @@ part 'episodic_button.g.dart'; @JsonSerializable() class EpisodicButton { - String? text; - String? uri; + String? text; + String? uri; - EpisodicButton({this.text, this.uri}); + EpisodicButton({this.text, this.uri}); - factory EpisodicButton.fromJson(Map json) { - return _$EpisodicButtonFromJson(json); - } + factory EpisodicButton.fromJson(Map json) { + return _$EpisodicButtonFromJson(json); + } - Map toJson() => _$EpisodicButtonToJson(this); + Map toJson() => _$EpisodicButtonToJson(this); } diff --git a/lib/models/space/fallback_layers.dart b/lib/models/space/fallback_layers.dart index f525b1ee..e61d9ac4 100644 --- a/lib/models/space/fallback_layers.dart +++ b/lib/models/space/fallback_layers.dart @@ -6,15 +6,15 @@ part 'fallback_layers.g.dart'; @JsonSerializable() class FallbackLayers { - List? layers; - @JsonKey(name: 'is_critical_group') - bool? isCriticalGroup; + List? layers; + @JsonKey(name: 'is_critical_group') + bool? isCriticalGroup; - FallbackLayers({this.layers, this.isCriticalGroup}); + FallbackLayers({this.layers, this.isCriticalGroup}); - factory FallbackLayers.fromJson(Map json) { - return _$FallbackLayersFromJson(json); - } + factory FallbackLayers.fromJson(Map json) { + return _$FallbackLayersFromJson(json); + } - Map toJson() => _$FallbackLayersToJson(this); + Map toJson() => _$FallbackLayersToJson(this); } diff --git a/lib/models/space/general_spec.dart b/lib/models/space/general_spec.dart index 081f6972..cabcc3d1 100644 --- a/lib/models/space/general_spec.dart +++ b/lib/models/space/general_spec.dart @@ -8,18 +8,18 @@ part 'general_spec.g.dart'; @JsonSerializable() class GeneralSpec { - @JsonKey(name: 'pos_spec') - PosSpec? posSpec; - @JsonKey(name: 'size_spec') - SizeSpec? sizeSpec; - @JsonKey(name: 'render_spec') - RenderSpec? renderSpec; + @JsonKey(name: 'pos_spec') + PosSpec? posSpec; + @JsonKey(name: 'size_spec') + SizeSpec? sizeSpec; + @JsonKey(name: 'render_spec') + RenderSpec? renderSpec; - GeneralSpec({this.posSpec, this.sizeSpec, this.renderSpec}); + GeneralSpec({this.posSpec, this.sizeSpec, this.renderSpec}); - factory GeneralSpec.fromJson(Map json) { - return _$GeneralSpecFromJson(json); - } + factory GeneralSpec.fromJson(Map json) { + return _$GeneralSpecFromJson(json); + } - Map toJson() => _$GeneralSpecToJson(this); + Map toJson() => _$GeneralSpecToJson(this); } diff --git a/lib/models/space/honours.dart b/lib/models/space/honours.dart index 482ccecf..bfa7a37d 100644 --- a/lib/models/space/honours.dart +++ b/lib/models/space/honours.dart @@ -6,14 +6,14 @@ part 'honours.g.dart'; @JsonSerializable() class Honours { - Colour? colour; - List? tags; + Colour? colour; + List? tags; - Honours({this.colour, this.tags}); + Honours({this.colour, this.tags}); - factory Honours.fromJson(Map json) { - return _$HonoursFromJson(json); - } + factory Honours.fromJson(Map json) { + return _$HonoursFromJson(json); + } - Map toJson() => _$HonoursToJson(this); + Map toJson() => _$HonoursToJson(this); } diff --git a/lib/models/space/layer.dart b/lib/models/space/layer.dart index 0ec99e52..42df5287 100644 --- a/lib/models/space/layer.dart +++ b/lib/models/space/layer.dart @@ -8,16 +8,16 @@ part 'layer.g.dart'; @JsonSerializable() class Layer { - bool? visible; - @JsonKey(name: 'general_spec') - GeneralSpec? generalSpec; - @JsonKey(name: 'layer_config') - LayerConfig? layerConfig; - Resource? resource; + bool? visible; + @JsonKey(name: 'general_spec') + GeneralSpec? generalSpec; + @JsonKey(name: 'layer_config') + LayerConfig? layerConfig; + Resource? resource; - Layer({this.visible, this.generalSpec, this.layerConfig, this.resource}); + Layer({this.visible, this.generalSpec, this.layerConfig, this.resource}); - factory Layer.fromJson(Map json) => _$LayerFromJson(json); + factory Layer.fromJson(Map json) => _$LayerFromJson(json); - Map toJson() => _$LayerToJson(this); + Map toJson() => _$LayerToJson(this); } diff --git a/lib/models/space/level_info.dart b/lib/models/space/level_info.dart index 40bfda80..8d10e6a0 100644 --- a/lib/models/space/level_info.dart +++ b/lib/models/space/level_info.dart @@ -6,30 +6,30 @@ part 'level_info.g.dart'; @JsonSerializable() class LevelInfo { - @JsonKey(name: 'current_level') - int? currentLevel; - @JsonKey(name: 'current_min') - int? currentMin; - @JsonKey(name: 'current_exp') - int? currentExp; - @JsonKey(name: 'next_exp') - dynamic nextExp; - int? identity; - @JsonKey(name: 'senior_inquiry') - SeniorInquiry? seniorInquiry; + @JsonKey(name: 'current_level') + int? currentLevel; + @JsonKey(name: 'current_min') + int? currentMin; + @JsonKey(name: 'current_exp') + int? currentExp; + @JsonKey(name: 'next_exp') + dynamic nextExp; + int? identity; + @JsonKey(name: 'senior_inquiry') + SeniorInquiry? seniorInquiry; - LevelInfo({ - this.currentLevel, - this.currentMin, - this.currentExp, - this.nextExp, - this.identity, - this.seniorInquiry, - }); + LevelInfo({ + this.currentLevel, + this.currentMin, + this.currentExp, + this.nextExp, + this.identity, + this.seniorInquiry, + }); - factory LevelInfo.fromJson(Map json) { - return _$LevelInfoFromJson(json); - } + factory LevelInfo.fromJson(Map json) { + return _$LevelInfoFromJson(json); + } - Map toJson() => _$LevelInfoToJson(this); + Map toJson() => _$LevelInfoToJson(this); } diff --git a/lib/models/space/nameplate.dart b/lib/models/space/nameplate.dart index e0ce7118..9e29df73 100644 --- a/lib/models/space/nameplate.dart +++ b/lib/models/space/nameplate.dart @@ -4,26 +4,26 @@ part 'nameplate.g.dart'; @JsonSerializable() class Nameplate { - int? nid; - String? name; - String? image; - @JsonKey(name: 'image_small') - String? imageSmall; - String? level; - String? condition; + int? nid; + String? name; + String? image; + @JsonKey(name: 'image_small') + String? imageSmall; + String? level; + String? condition; - Nameplate({ - this.nid, - this.name, - this.image, - this.imageSmall, - this.level, - this.condition, - }); + Nameplate({ + this.nid, + this.name, + this.image, + this.imageSmall, + this.level, + this.condition, + }); - factory Nameplate.fromJson(Map json) { - return _$NameplateFromJson(json); - } + factory Nameplate.fromJson(Map json) { + return _$NameplateFromJson(json); + } - Map toJson() => _$NameplateToJson(this); + Map toJson() => _$NameplateToJson(this); } diff --git a/lib/models/space/nft_certificate.dart b/lib/models/space/nft_certificate.dart index 2d5f16e7..6dc33039 100644 --- a/lib/models/space/nft_certificate.dart +++ b/lib/models/space/nft_certificate.dart @@ -4,14 +4,14 @@ part 'nft_certificate.g.dart'; @JsonSerializable() class NftCertificate { - @JsonKey(name: 'detail_url') - String? detailUrl; + @JsonKey(name: 'detail_url') + String? detailUrl; - NftCertificate({this.detailUrl}); + NftCertificate({this.detailUrl}); - factory NftCertificate.fromJson(Map json) { - return _$NftCertificateFromJson(json); - } + factory NftCertificate.fromJson(Map json) { + return _$NftCertificateFromJson(json); + } - Map toJson() => _$NftCertificateToJson(this); + Map toJson() => _$NftCertificateToJson(this); } diff --git a/lib/models/space/night.dart b/lib/models/space/night.dart index c5646181..f646ec3d 100644 --- a/lib/models/space/night.dart +++ b/lib/models/space/night.dart @@ -4,11 +4,11 @@ part 'night.g.dart'; @JsonSerializable() class Night { - String? argb; + String? argb; - Night({this.argb}); + Night({this.argb}); - factory Night.fromJson(Map json) => _$NightFromJson(json); + factory Night.fromJson(Map json) => _$NightFromJson(json); - Map toJson() => _$NightToJson(this); + Map toJson() => _$NightToJson(this); } diff --git a/lib/models/space/order.dart b/lib/models/space/order.dart index 26c7373d..b88e7280 100644 --- a/lib/models/space/order.dart +++ b/lib/models/space/order.dart @@ -4,12 +4,12 @@ part 'order.g.dart'; @JsonSerializable() class Order { - String? title; - String? value; + String? title; + String? value; - Order({this.title, this.value}); + Order({this.title, this.value}); - factory Order.fromJson(Map json) => _$OrderFromJson(json); + factory Order.fromJson(Map json) => _$OrderFromJson(json); - Map toJson() => _$OrderToJson(this); + Map toJson() => _$OrderToJson(this); } diff --git a/lib/models/space/pos_spec.dart b/lib/models/space/pos_spec.dart index 49ac42ec..8792b0cc 100644 --- a/lib/models/space/pos_spec.dart +++ b/lib/models/space/pos_spec.dart @@ -4,18 +4,18 @@ part 'pos_spec.g.dart'; @JsonSerializable() class PosSpec { - @JsonKey(name: 'coordinate_pos') - int? coordinatePos; - @JsonKey(name: 'axis_x') - double? axisX; - @JsonKey(name: 'axis_y') - double? axisY; + @JsonKey(name: 'coordinate_pos') + int? coordinatePos; + @JsonKey(name: 'axis_x') + double? axisX; + @JsonKey(name: 'axis_y') + double? axisY; - PosSpec({this.coordinatePos, this.axisX, this.axisY}); + PosSpec({this.coordinatePos, this.axisX, this.axisY}); - factory PosSpec.fromJson(Map json) { - return _$PosSpecFromJson(json); - } + factory PosSpec.fromJson(Map json) { + return _$PosSpecFromJson(json); + } - Map toJson() => _$PosSpecToJson(this); + Map toJson() => _$PosSpecToJson(this); } diff --git a/lib/models/space/profession_verify.dart b/lib/models/space/profession_verify.dart index 067b5a1e..98285e0d 100644 --- a/lib/models/space/profession_verify.dart +++ b/lib/models/space/profession_verify.dart @@ -4,15 +4,15 @@ part 'profession_verify.g.dart'; @JsonSerializable() class ProfessionVerify { - String? icon; - @JsonKey(name: 'show_desc') - String? showDesc; + String? icon; + @JsonKey(name: 'show_desc') + String? showDesc; - ProfessionVerify({this.icon, this.showDesc}); + ProfessionVerify({this.icon, this.showDesc}); - factory ProfessionVerify.fromJson(Map json) { - return _$ProfessionVerifyFromJson(json); - } + factory ProfessionVerify.fromJson(Map json) { + return _$ProfessionVerifyFromJson(json); + } - Map toJson() => _$ProfessionVerifyToJson(this); + Map toJson() => _$ProfessionVerifyToJson(this); } diff --git a/lib/models/space/purchase_button.dart b/lib/models/space/purchase_button.dart index 4d695ade..eae6ad07 100644 --- a/lib/models/space/purchase_button.dart +++ b/lib/models/space/purchase_button.dart @@ -4,14 +4,14 @@ part 'purchase_button.g.dart'; @JsonSerializable() class PurchaseButton { - String? uri; - String? title; + String? uri; + String? title; - PurchaseButton({this.uri, this.title}); + PurchaseButton({this.uri, this.title}); - factory PurchaseButton.fromJson(Map json) { - return _$PurchaseButtonFromJson(json); - } + factory PurchaseButton.fromJson(Map json) { + return _$PurchaseButtonFromJson(json); + } - Map toJson() => _$PurchaseButtonToJson(this); + Map toJson() => _$PurchaseButtonToJson(this); } diff --git a/lib/models/space/render_spec.dart b/lib/models/space/render_spec.dart index 3b75fb0c..f08d3be4 100644 --- a/lib/models/space/render_spec.dart +++ b/lib/models/space/render_spec.dart @@ -4,13 +4,13 @@ part 'render_spec.g.dart'; @JsonSerializable() class RenderSpec { - int? opacity; + int? opacity; - RenderSpec({this.opacity}); + RenderSpec({this.opacity}); - factory RenderSpec.fromJson(Map json) { - return _$RenderSpecFromJson(json); - } + factory RenderSpec.fromJson(Map json) { + return _$RenderSpecFromJson(json); + } - Map toJson() => _$RenderSpecToJson(this); + Map toJson() => _$RenderSpecToJson(this); } diff --git a/lib/models/space/res_native_draw.dart b/lib/models/space/res_native_draw.dart index cc7f4b63..e3106a6f 100644 --- a/lib/models/space/res_native_draw.dart +++ b/lib/models/space/res_native_draw.dart @@ -6,14 +6,14 @@ part 'res_native_draw.g.dart'; @JsonSerializable() class ResNativeDraw { - @JsonKey(name: 'draw_src') - DrawSrc? drawSrc; + @JsonKey(name: 'draw_src') + DrawSrc? drawSrc; - ResNativeDraw({this.drawSrc}); + ResNativeDraw({this.drawSrc}); - factory ResNativeDraw.fromJson(Map json) { - return _$ResNativeDrawFromJson(json); - } + factory ResNativeDraw.fromJson(Map json) { + return _$ResNativeDrawFromJson(json); + } - Map toJson() => _$ResNativeDrawToJson(this); + Map toJson() => _$ResNativeDrawToJson(this); } diff --git a/lib/models/space/resource.dart b/lib/models/space/resource.dart index fceb95bf..a17c4748 100644 --- a/lib/models/space/resource.dart +++ b/lib/models/space/resource.dart @@ -6,16 +6,16 @@ part 'resource.g.dart'; @JsonSerializable() class Resource { - @JsonKey(name: 'res_type') - int? resType; - @JsonKey(name: 'res_native_draw') - ResNativeDraw? resNativeDraw; + @JsonKey(name: 'res_type') + int? resType; + @JsonKey(name: 'res_native_draw') + ResNativeDraw? resNativeDraw; - Resource({this.resType, this.resNativeDraw}); + Resource({this.resType, this.resNativeDraw}); - factory Resource.fromJson(Map json) { - return _$ResourceFromJson(json); - } + factory Resource.fromJson(Map json) { + return _$ResourceFromJson(json); + } - Map toJson() => _$ResourceToJson(this); + Map toJson() => _$ResourceToJson(this); } diff --git a/lib/models/space/senior_inquiry.dart b/lib/models/space/senior_inquiry.dart index b6cd0433..6e93a821 100644 --- a/lib/models/space/senior_inquiry.dart +++ b/lib/models/space/senior_inquiry.dart @@ -4,16 +4,16 @@ part 'senior_inquiry.g.dart'; @JsonSerializable() class SeniorInquiry { - @JsonKey(name: 'inquiry_text') - String? inquiryText; - @JsonKey(name: 'inquiry_url') - String? inquiryUrl; + @JsonKey(name: 'inquiry_text') + String? inquiryText; + @JsonKey(name: 'inquiry_url') + String? inquiryUrl; - SeniorInquiry({this.inquiryText, this.inquiryUrl}); + SeniorInquiry({this.inquiryText, this.inquiryUrl}); - factory SeniorInquiry.fromJson(Map json) { - return _$SeniorInquiryFromJson(json); - } + factory SeniorInquiry.fromJson(Map json) { + return _$SeniorInquiryFromJson(json); + } - Map toJson() => _$SeniorInquiryToJson(this); + Map toJson() => _$SeniorInquiryToJson(this); } diff --git a/lib/models/space/series.dart b/lib/models/space/series.dart index cc7fc255..877b9ed7 100644 --- a/lib/models/space/series.dart +++ b/lib/models/space/series.dart @@ -4,13 +4,13 @@ part 'series.g.dart'; @JsonSerializable() class Series { - List? item; + List? item; - Series({this.item}); + Series({this.item}); - factory Series.fromJson(Map json) { - return _$SeriesFromJson(json); - } + factory Series.fromJson(Map json) { + return _$SeriesFromJson(json); + } - Map toJson() => _$SeriesToJson(this); + Map toJson() => _$SeriesToJson(this); } diff --git a/lib/models/space/setting.dart b/lib/models/space/setting.dart index 184166bf..a97fe3c2 100644 --- a/lib/models/space/setting.dart +++ b/lib/models/space/setting.dart @@ -4,65 +4,65 @@ part 'setting.g.dart'; @JsonSerializable() class Setting { - int? channel; - @JsonKey(name: 'fav_video') - int? favVideo; - @JsonKey(name: 'coins_video') - int? coinsVideo; - @JsonKey(name: 'likes_video') - int? likesVideo; - int? bangumi; - @JsonKey(name: 'played_game') - int? playedGame; - int? groups; - int? comic; - int? bbq; - @JsonKey(name: 'dress_up') - int? dressUp; - @JsonKey(name: 'disable_following') - int? disableFollowing; - @JsonKey(name: 'live_playback') - int? livePlayback; - @JsonKey(name: 'close_space_medal') - int? closeSpaceMedal; - @JsonKey(name: 'only_show_wearing') - int? onlyShowWearing; - @JsonKey(name: 'disable_show_school') - int? disableShowSchool; - @JsonKey(name: 'disable_show_nft') - int? disableShowNft; - @JsonKey(name: 'disable_show_fans') - int? disableShowFans; - @JsonKey(name: 'charge_video') - int? chargeVideo; - @JsonKey(name: 'lesson_video') - int? lessonVideo; + int? channel; + @JsonKey(name: 'fav_video') + int? favVideo; + @JsonKey(name: 'coins_video') + int? coinsVideo; + @JsonKey(name: 'likes_video') + int? likesVideo; + int? bangumi; + @JsonKey(name: 'played_game') + int? playedGame; + int? groups; + int? comic; + int? bbq; + @JsonKey(name: 'dress_up') + int? dressUp; + @JsonKey(name: 'disable_following') + int? disableFollowing; + @JsonKey(name: 'live_playback') + int? livePlayback; + @JsonKey(name: 'close_space_medal') + int? closeSpaceMedal; + @JsonKey(name: 'only_show_wearing') + int? onlyShowWearing; + @JsonKey(name: 'disable_show_school') + int? disableShowSchool; + @JsonKey(name: 'disable_show_nft') + int? disableShowNft; + @JsonKey(name: 'disable_show_fans') + int? disableShowFans; + @JsonKey(name: 'charge_video') + int? chargeVideo; + @JsonKey(name: 'lesson_video') + int? lessonVideo; - Setting({ - this.channel, - this.favVideo, - this.coinsVideo, - this.likesVideo, - this.bangumi, - this.playedGame, - this.groups, - this.comic, - this.bbq, - this.dressUp, - this.disableFollowing, - this.livePlayback, - this.closeSpaceMedal, - this.onlyShowWearing, - this.disableShowSchool, - this.disableShowNft, - this.disableShowFans, - this.chargeVideo, - this.lessonVideo, - }); + Setting({ + this.channel, + this.favVideo, + this.coinsVideo, + this.likesVideo, + this.bangumi, + this.playedGame, + this.groups, + this.comic, + this.bbq, + this.dressUp, + this.disableFollowing, + this.livePlayback, + this.closeSpaceMedal, + this.onlyShowWearing, + this.disableShowSchool, + this.disableShowNft, + this.disableShowFans, + this.chargeVideo, + this.lessonVideo, + }); - factory Setting.fromJson(Map json) { - return _$SettingFromJson(json); - } + factory Setting.fromJson(Map json) { + return _$SettingFromJson(json); + } - Map toJson() => _$SettingToJson(this); + Map toJson() => _$SettingToJson(this); } diff --git a/lib/models/space/size_spec.dart b/lib/models/space/size_spec.dart index 21fa854e..4eee2408 100644 --- a/lib/models/space/size_spec.dart +++ b/lib/models/space/size_spec.dart @@ -4,14 +4,14 @@ part 'size_spec.g.dart'; @JsonSerializable() class SizeSpec { - double? width; - double? height; + double? width; + double? height; - SizeSpec({this.width, this.height}); + SizeSpec({this.width, this.height}); - factory SizeSpec.fromJson(Map json) { - return _$SizeSpecFromJson(json); - } + factory SizeSpec.fromJson(Map json) { + return _$SizeSpecFromJson(json); + } - Map toJson() => _$SizeSpecToJson(this); + Map toJson() => _$SizeSpecToJson(this); } diff --git a/lib/models/space_archive/badge.dart b/lib/models/space_archive/badge.dart index 689b0e2d..9fee325b 100644 --- a/lib/models/space_archive/badge.dart +++ b/lib/models/space_archive/badge.dart @@ -4,34 +4,34 @@ part 'badge.g.dart'; @JsonSerializable() class Badge { - String? text; - @JsonKey(name: 'text_color') - String? textColor; - @JsonKey(name: 'text_color_night') - String? textColorNight; - @JsonKey(name: 'bg_color') - String? bgColor; - @JsonKey(name: 'bg_color_night') - String? bgColorNight; - @JsonKey(name: 'border_color') - String? borderColor; - @JsonKey(name: 'border_color_night') - String? borderColorNight; - @JsonKey(name: 'bg_style') - int? bgStyle; + String? text; + @JsonKey(name: 'text_color') + String? textColor; + @JsonKey(name: 'text_color_night') + String? textColorNight; + @JsonKey(name: 'bg_color') + String? bgColor; + @JsonKey(name: 'bg_color_night') + String? bgColorNight; + @JsonKey(name: 'border_color') + String? borderColor; + @JsonKey(name: 'border_color_night') + String? borderColorNight; + @JsonKey(name: 'bg_style') + int? bgStyle; - Badge({ - this.text, - this.textColor, - this.textColorNight, - this.bgColor, - this.bgColorNight, - this.borderColor, - this.borderColorNight, - this.bgStyle, - }); + Badge({ + this.text, + this.textColor, + this.textColorNight, + this.bgColor, + this.bgColorNight, + this.borderColor, + this.borderColorNight, + this.bgStyle, + }); - factory Badge.fromJson(Map json) => _$BadgeFromJson(json); + factory Badge.fromJson(Map json) => _$BadgeFromJson(json); - Map toJson() => _$BadgeToJson(this); + Map toJson() => _$BadgeToJson(this); } diff --git a/lib/models/space_archive/cursor_attr.dart b/lib/models/space_archive/cursor_attr.dart index ca2d5f23..0c8cf769 100644 --- a/lib/models/space_archive/cursor_attr.dart +++ b/lib/models/space_archive/cursor_attr.dart @@ -4,15 +4,15 @@ part 'cursor_attr.g.dart'; @JsonSerializable() class CursorAttr { - @JsonKey(name: 'is_last_watched_arc') - bool? isLastWatchedArc; - int? rank; + @JsonKey(name: 'is_last_watched_arc') + bool? isLastWatchedArc; + int? rank; - CursorAttr({this.isLastWatchedArc, this.rank}); + CursorAttr({this.isLastWatchedArc, this.rank}); - factory CursorAttr.fromJson(Map json) { - return _$CursorAttrFromJson(json); - } + factory CursorAttr.fromJson(Map json) { + return _$CursorAttrFromJson(json); + } - Map toJson() => _$CursorAttrToJson(this); + Map toJson() => _$CursorAttrToJson(this); } diff --git a/lib/models/space_archive/episodic_button.dart b/lib/models/space_archive/episodic_button.dart index a4523188..f5ed34b0 100644 --- a/lib/models/space_archive/episodic_button.dart +++ b/lib/models/space_archive/episodic_button.dart @@ -4,14 +4,14 @@ part 'episodic_button.g.dart'; @JsonSerializable() class EpisodicButton { - String? text; - String? uri; + String? text; + String? uri; - EpisodicButton({this.text, this.uri}); + EpisodicButton({this.text, this.uri}); - factory EpisodicButton.fromJson(Map json) { - return _$EpisodicButtonFromJson(json); - } + factory EpisodicButton.fromJson(Map json) { + return _$EpisodicButtonFromJson(json); + } - Map toJson() => _$EpisodicButtonToJson(this); + Map toJson() => _$EpisodicButtonToJson(this); } diff --git a/lib/models/space_archive/last_watched_locator.dart b/lib/models/space_archive/last_watched_locator.dart index bf9974eb..fb688cdd 100644 --- a/lib/models/space_archive/last_watched_locator.dart +++ b/lib/models/space_archive/last_watched_locator.dart @@ -4,21 +4,21 @@ part 'last_watched_locator.g.dart'; @JsonSerializable() class LastWatchedLocator { - @JsonKey(name: 'display_threshold') - int? displayThreshold; - @JsonKey(name: 'insert_ranking') - int? insertRanking; - String? text; + @JsonKey(name: 'display_threshold') + int? displayThreshold; + @JsonKey(name: 'insert_ranking') + int? insertRanking; + String? text; - LastWatchedLocator({ - this.displayThreshold, - this.insertRanking, - this.text, - }); + LastWatchedLocator({ + this.displayThreshold, + this.insertRanking, + this.text, + }); - factory LastWatchedLocator.fromJson(Map json) { - return _$LastWatchedLocatorFromJson(json); - } + factory LastWatchedLocator.fromJson(Map json) { + return _$LastWatchedLocatorFromJson(json); + } - Map toJson() => _$LastWatchedLocatorToJson(this); + Map toJson() => _$LastWatchedLocatorToJson(this); } diff --git a/lib/models/space_archive/order.dart b/lib/models/space_archive/order.dart index 26c7373d..b88e7280 100644 --- a/lib/models/space_archive/order.dart +++ b/lib/models/space_archive/order.dart @@ -4,12 +4,12 @@ part 'order.g.dart'; @JsonSerializable() class Order { - String? title; - String? value; + String? title; + String? value; - Order({this.title, this.value}); + Order({this.title, this.value}); - factory Order.fromJson(Map json) => _$OrderFromJson(json); + factory Order.fromJson(Map json) => _$OrderFromJson(json); - Map toJson() => _$OrderToJson(this); + Map toJson() => _$OrderToJson(this); } diff --git a/lib/models/space_article/category.dart b/lib/models/space_article/category.dart index 98916bb2..267a4597 100644 --- a/lib/models/space_article/category.dart +++ b/lib/models/space_article/category.dart @@ -4,16 +4,16 @@ part 'category.g.dart'; @JsonSerializable() class Category { - int? id; - @JsonKey(name: 'parent_id') - int? parentId; - String? name; + int? id; + @JsonKey(name: 'parent_id') + int? parentId; + String? name; - Category({this.id, this.parentId, this.name}); + Category({this.id, this.parentId, this.name}); - factory Category.fromJson(Map json) { - return _$CategoryFromJson(json); - } + factory Category.fromJson(Map json) { + return _$CategoryFromJson(json); + } - Map toJson() => _$CategoryToJson(this); + Map toJson() => _$CategoryToJson(this); } diff --git a/lib/models/space_article/item.dart b/lib/models/space_article/item.dart index f7217d6e..951cf751 100644 --- a/lib/models/space_article/item.dart +++ b/lib/models/space_article/item.dart @@ -1,5 +1,7 @@ -import 'package:PiliPlus/models/dynamics/article_content_model.dart'; +import 'dart:convert'; +import 'package:PiliPlus/models/dynamics/article_content_model.dart'; +import 'package:PiliPlus/models/dynamics/article_opus/opus.dart'; import 'package:PiliPlus/models/space_article/author.dart'; import 'package:PiliPlus/models/space_article/category.dart'; import 'package:PiliPlus/models/space_article/media.dart'; @@ -55,6 +57,7 @@ class SpaceArticleItem { int? versionId; String? dynIdStr; int? totalArtNum; + List? ops; SpaceArticleItem.fromJson(Map json) { id = json["id"]; @@ -105,8 +108,13 @@ class SpaceArticleItem { keywords = json["keywords"]; if (json['opus'] != null) opus = Opus.fromJson(json['opus']); versionId = json["version_id"]; - dynIdStr = json["dyn_id_str"]; + dynIdStr = json["dyn_id_str"] == '' ? null : json["dyn_id_str"]; totalArtNum = json["total_art_num"]; + if (type == 3 && content != null) { + ops = (jsonDecode(content!)['ops'] as List?) + ?.map((e) => ReadOpusModel.fromJson(e)) + .toList(); + } } } diff --git a/lib/models/space_article/label.dart b/lib/models/space_article/label.dart index e517c679..09ce52e2 100644 --- a/lib/models/space_article/label.dart +++ b/lib/models/space_article/label.dart @@ -4,14 +4,14 @@ part 'label.g.dart'; @JsonSerializable() class Label { - String? path; - String? text; - @JsonKey(name: 'label_theme') - String? labelTheme; + String? path; + String? text; + @JsonKey(name: 'label_theme') + String? labelTheme; - Label({this.path, this.text, this.labelTheme}); + Label({this.path, this.text, this.labelTheme}); - factory Label.fromJson(Map json) => _$LabelFromJson(json); + factory Label.fromJson(Map json) => _$LabelFromJson(json); - Map toJson() => _$LabelToJson(this); + Map toJson() => _$LabelToJson(this); } diff --git a/lib/models/space_article/media.dart b/lib/models/space_article/media.dart index ba440358..0def1433 100644 --- a/lib/models/space_article/media.dart +++ b/lib/models/space_article/media.dart @@ -4,30 +4,30 @@ part 'media.g.dart'; @JsonSerializable() class Media { - int? score; - @JsonKey(name: 'media_id') - int? mediaId; - String? title; - String? cover; - String? area; - @JsonKey(name: 'type_id') - int? typeId; - @JsonKey(name: 'type_name') - String? typeName; - int? spoiler; + int? score; + @JsonKey(name: 'media_id') + int? mediaId; + String? title; + String? cover; + String? area; + @JsonKey(name: 'type_id') + int? typeId; + @JsonKey(name: 'type_name') + String? typeName; + int? spoiler; - Media({ - this.score, - this.mediaId, - this.title, - this.cover, - this.area, - this.typeId, - this.typeName, - this.spoiler, - }); + Media({ + this.score, + this.mediaId, + this.title, + this.cover, + this.area, + this.typeId, + this.typeName, + this.spoiler, + }); - factory Media.fromJson(Map json) => _$MediaFromJson(json); + factory Media.fromJson(Map json) => _$MediaFromJson(json); - Map toJson() => _$MediaToJson(this); + Map toJson() => _$MediaToJson(this); } diff --git a/lib/models/space_article/nameplate.dart b/lib/models/space_article/nameplate.dart index e0ce7118..9e29df73 100644 --- a/lib/models/space_article/nameplate.dart +++ b/lib/models/space_article/nameplate.dart @@ -4,26 +4,26 @@ part 'nameplate.g.dart'; @JsonSerializable() class Nameplate { - int? nid; - String? name; - String? image; - @JsonKey(name: 'image_small') - String? imageSmall; - String? level; - String? condition; + int? nid; + String? name; + String? image; + @JsonKey(name: 'image_small') + String? imageSmall; + String? level; + String? condition; - Nameplate({ - this.nid, - this.name, - this.image, - this.imageSmall, - this.level, - this.condition, - }); + Nameplate({ + this.nid, + this.name, + this.image, + this.imageSmall, + this.level, + this.condition, + }); - factory Nameplate.fromJson(Map json) { - return _$NameplateFromJson(json); - } + factory Nameplate.fromJson(Map json) { + return _$NameplateFromJson(json); + } - Map toJson() => _$NameplateToJson(this); + Map toJson() => _$NameplateToJson(this); } diff --git a/lib/models/space_opus/stat.dart b/lib/models/space_opus/stat.dart index 726f15e5..c8bebe5b 100644 --- a/lib/models/space_opus/stat.dart +++ b/lib/models/space_opus/stat.dart @@ -1,13 +1,13 @@ class Stat { - String? like; + String? like; - Stat({this.like}); + Stat({this.like}); - factory Stat.fromJson(Map json) => Stat( - like: json['like'] as String?, - ); + factory Stat.fromJson(Map json) => Stat( + like: json['like'] as String?, + ); - Map toJson() => { - 'like': like, - }; + Map toJson() => { + 'like': like, + }; } diff --git a/lib/pages/article/view.dart b/lib/pages/article/view.dart index d5056e7d..68ad9147 100644 --- a/lib/pages/article/view.dart +++ b/lib/pages/article/view.dart @@ -17,6 +17,7 @@ import 'package:PiliPlus/models/dynamics/result.dart' show DynamicStat; import 'package:PiliPlus/pages/article/controller.dart'; import 'package:PiliPlus/pages/article/widgets/html_render.dart'; import 'package:PiliPlus/pages/article/widgets/opus_content.dart'; +import 'package:PiliPlus/pages/article/widgets/read_opus.dart'; import 'package:PiliPlus/pages/dynamics_repost/view.dart'; import 'package:PiliPlus/pages/video/reply/widgets/reply_item_grpc.dart'; import 'package:PiliPlus/pages/video/reply_reply/view.dart'; @@ -360,6 +361,10 @@ class _ArticlePageState extends State child: moduleBlockedItem(theme, moduleBlocked, maxWidth), ); } else if (_articleCtr.articleData?.content != null) { + if (_articleCtr.articleData?.type == 3) { + // json + return ReadOpus(ops: _articleCtr.articleData?.ops); + } debugPrint('html page'); final res = parser.parse(_articleCtr.articleData!.content!); if (res.body!.children.isEmpty) { diff --git a/lib/pages/article/widgets/read_opus.dart b/lib/pages/article/widgets/read_opus.dart new file mode 100644 index 00000000..9abccd63 --- /dev/null +++ b/lib/pages/article/widgets/read_opus.dart @@ -0,0 +1,77 @@ +import 'package:PiliPlus/common/constants.dart'; +import 'package:PiliPlus/models/dynamics/article_opus/opus.dart'; +import 'package:PiliPlus/pages/dynamics/widgets/vote.dart'; +import 'package:PiliPlus/utils/app_scheme.dart'; +import 'package:PiliPlus/utils/extension.dart'; +import 'package:PiliPlus/utils/utils.dart'; +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +class ReadOpus extends StatelessWidget { + const ReadOpus({super.key, required this.ops}); + + final List? ops; + + @override + Widget build(BuildContext context) { + if (ops.isNullOrEmpty) { + return const SliverToBoxAdapter(); + } + + return SliverList.separated( + itemCount: ops!.length, + itemBuilder: (context, index) { + try { + final item = ops![index]; + if (item.insert is String) { + return SelectableText(item.insert); + } + + if (item.insert is Insert) { + InsertCard card = item.insert.card; + if (card.url?.isNotEmpty == true) { + return GestureDetector( + onTap: () { + switch (item.attributes?.clazz) { + case 'article-card card': + if (card.id != null) { + Get.toNamed( + '/articlePage', + parameters: { + 'id': card.id!.substring(2), + 'type': 'read', + }, + ); + } + case 'video-card card': + if (card.id != null) { + PiliScheme.videoPush(null, card.id); + } + case 'vote-card card': + if (card.id != null) { + showVoteDialog(context, card.id); + } + } + }, + child: ClipRRect( + borderRadius: StyleString.mdRadius, + child: CachedNetworkImage( + imageUrl: Utils.thumbnailImgUrl(card.url, 60), + ), + ), + ); + } + } + + return Text('${item.attributes}'); + } catch (e) { + return Text(e.toString()); + } + }, + separatorBuilder: (context, index) { + return const SizedBox(height: 10); + }, + ); + } +} diff --git a/lib/pages/dynamics/view.dart b/lib/pages/dynamics/view.dart index 433fd9e5..4e52feb7 100644 --- a/lib/pages/dynamics/view.dart +++ b/lib/pages/dynamics/view.dart @@ -171,7 +171,7 @@ class _DynamicsPageState extends State children: [ if (upPanelPosition == UpPanelPosition.top) upPanelPart(theme), Expanded( - child: tabBarView( + child: videoTabBarView( controller: _dynamicsController.tabController, children: _dynamicsController.tabsPageList, ),