fix subtitle

This commit is contained in:
2024-11-30 13:50:07 +08:00
committed by nyne
parent b30bd11d1a
commit d96b36414d
3 changed files with 9 additions and 4 deletions

View File

@@ -877,6 +877,8 @@ function Comic({id, title, subtitle, subTitle, cover, tags, description, maxPage
/** /**
* Create a comic details object * Create a comic details object
* @param title {string} * @param title {string}
* @param subtitle {string}
* @param subTitle {string} - equal to subtitle
* @param cover {string} * @param cover {string}
* @param description {string?} * @param description {string?}
* @param tags {Map<string, string[]> | {} | null | undefined} * @param tags {Map<string, string[]> | {} | null | undefined}
@@ -897,8 +899,9 @@ function Comic({id, title, subtitle, subTitle, cover, tags, description, maxPage
* @param comments {Comment[]?}- `since 1.0.7` App will display comments in the details page. * @param comments {Comment[]?}- `since 1.0.7` App will display comments in the details page.
* @constructor * @constructor
*/ */
function ComicDetails({title, cover, description, tags, chapters, isFavorite, subId, thumbnails, recommend, commentCount, likesCount, isLiked, uploader, updateTime, uploadTime, url, stars, maxPage, comments}) { function ComicDetails({title, subtitle, subTitle, cover, description, tags, chapters, isFavorite, subId, thumbnails, recommend, commentCount, likesCount, isLiked, uploader, updateTime, uploadTime, url, stars, maxPage, comments}) {
this.title = title; this.title = title;
this.subtitle = subtitle ?? subTitle;
this.cover = cover; this.cover = cover;
this.description = description; this.description = description;
this.tags = tags; this.tags = tags;

View File

@@ -172,7 +172,7 @@ class ComicDetails with HistoryMixin {
ComicDetails.fromJson(Map<String, dynamic> json) ComicDetails.fromJson(Map<String, dynamic> json)
: title = json["title"], : title = json["title"],
subTitle = json["subTitle"], subTitle = json["subtitle"],
cover = json["cover"], cover = json["cover"],
description = json["description"], description = json["description"],
tags = _generateMap(json["tags"]), tags = _generateMap(json["tags"]),
@@ -198,7 +198,9 @@ class ComicDetails with HistoryMixin {
maxPage = json["maxPage"], maxPage = json["maxPage"],
comments = (json["comments"] as List?) comments = (json["comments"] as List?)
?.map((e) => Comment.fromJson(e)) ?.map((e) => Comment.fromJson(e))
.toList(); .toList(){
print(json);
}
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
return { return {

View File

@@ -223,7 +223,7 @@ class _ComicPageState extends LoadingState<ComicPage, ComicDetails>
children: [ children: [
SelectableText(comic.title, style: ts.s18), SelectableText(comic.title, style: ts.s18),
if (comic.subTitle != null) if (comic.subTitle != null)
SelectableText(comic.subTitle!, style: ts.s14), SelectableText(comic.subTitle!, style: ts.s14).paddingVertical(4),
Text( Text(
(ComicSource.find(comic.sourceKey)?.name) ?? '', (ComicSource.find(comic.sourceKey)?.name) ?? '',
style: ts.s12, style: ts.s12,