From 2030cfaaacbf7b0618bab7e6fabe889b5cac1cdc Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 11:12:48 +0800 Subject: [PATCH 01/32] =?UTF-8?q?=E6=BC=AB=E7=94=BB=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E6=94=AF=E6=8C=81=E7=A6=BB=E7=BA=BF=E5=88=86=E9=98=B6?= =?UTF-8?q?=E6=AE=B5=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit comic_page.dart 中 ComicPageLogic.get() 原为"全网络或全无"模式, 无网络时 data 为 null,直接显示 NetworkError,用户看不到任何信息。 改为"先本地、后网络"两阶段加载: - 阶段1:立即从下载记录/阅读历史提取本地已有的标题、封面, 先渲染页面使收藏/删除下载等操作按钮离线可用 - 阶段2:同时发起网络请求获取完整数据,成功后覆盖本地数据 具体改动: - ComicPageLogic 新增 networkMessage、loadLocalData 字段 - get() 拆分为两个阶段,本地数据命中时提前 setState 渲染 - BaseComicPage 新增 loadLocalData() 方法(默认返回 null,不影响已有子类) - _ComicPageImpl.loadLocalData() 按优先级查询下载记录→阅读历史 - loadFavorite() 改为 OR 逻辑,平台和本地任意一边收藏即为"已收藏" - build() 注入 loadLocalData 回调,网络失败时 toast 提示 - refresh_() 清空 networkMessage 状态 仅影响走 _ComicPageImpl 路径的自定义源; 内置源的 PicacgComicPage 等子类 loadLocalData 默认 null,行为不变。 --- lib/pages/comic_page.dart | 116 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 110 insertions(+), 6 deletions(-) diff --git a/lib/pages/comic_page.dart b/lib/pages/comic_page.dart index 114db277c..4a17a88fc 100644 --- a/lib/pages/comic_page.dart +++ b/lib/pages/comic_page.dart @@ -18,6 +18,7 @@ import 'package:pica_comic/foundation/log.dart'; import 'package:pica_comic/foundation/stack.dart' as stack; import 'package:pica_comic/foundation/ui_mode.dart'; import 'package:pica_comic/network/base_comic.dart'; +import 'package:pica_comic/network/custom_download_model.dart'; import 'package:pica_comic/network/download.dart'; import 'package:pica_comic/network/res.dart'; import 'package:pica_comic/pages/favorites/local_favorites.dart'; @@ -160,7 +161,68 @@ class _ComicPageImpl extends BaseComicPage { @override Future loadFavorite(ComicInfoData data) async { - return data.isFavorite ?? false; + bool platformFavorite = data.isFavorite ?? false; + bool localFavorite = LocalFavoritesManager().isExist(id); + return platformFavorite || localFavorite; + } + + @override + Future loadLocalData() async { + final downloadId = DownloadManager().generateId(sourceKey, id); + + // 优先级1:已下载的记录(数据最完整:title、cover、tags、可能包含 chapters) + DownloadedItem? downloaded; + try { + if (DownloadManager().isExists(downloadId)) { + downloaded = await DownloadManager().getComicOrNull(downloadId); + } + } catch (_) {} + + if (downloaded != null) { + return ComicInfoData( + downloaded.name, + downloaded.subTitle, + downloaded.cover, + null, + _tagsListToMap(downloaded.tags), + downloaded is CustomDownloadedItem + ? (downloaded as CustomDownloadedItem).chapters + : null, + null, + null, + 0, + null, + sourceKey, + id, + ); + } + + // 优先级2:阅读历史(已在 get() 阶段1中查询,存在 _logic.history 中) + final h = _logic.history; + if (h != null && h.title.isNotEmpty) { + return ComicInfoData( + h.title, + h.subtitle, + h.cover, + null, + {}, + null, + null, + null, + 0, + null, + sourceKey, + id, + ); + } + + return null; + } + + /// 辅助方法:将 List tags 转为 Map> + static Map> _tagsListToMap(List tags) { + if (tags.isEmpty) return {}; + return {"tags": tags}; } @override @@ -599,28 +661,56 @@ class ComicPageLogic extends StateController { int colorIndex = 0; bool? favoriteOnPlatform; + /// 网络加载失败时的信息(有本地数据时网络失败用 toast 展示,不阻塞页面) + String? networkMessage; + + /// 由 [BaseComicPage] 在首次构建时注入,指向子类的 loadLocalData 方法 + Future Function()? loadLocalData; + void get(Future> Function() loadData, Future Function(T) loadFavorite, String Function() getId) async { + // ======== 阶段1:加载本地数据和历史 ======== + history = await HistoryManager().find(getId()); + + if (loadLocalData != null) { + var local = await loadLocalData!(); + if (local != null) { + data = local; + favorite = await loadFavorite(local); + loading = false; + update(); + } + } + + // ======== 阶段2:加载网络数据 ======== var [res, _] = await Future.wait( [loadData(), Future.delayed(const Duration(milliseconds: 300))]); + if (res.error) { - message = res.errorMessage; - if (message == "Exit") { - loading = false; - return; + if (data == null) { + message = res.errorMessage; + if (message == "Exit") { + loading = false; + return; + } + } else { + networkMessage = res.errorMessage; } } else { data = res.data; favorite = await loadFavorite(res.data); + message = null; + networkMessage = null; } + loading = false; - history = await HistoryManager().find(getId()); update(); } void refresh_() { data = null; message = null; + networkMessage = null; loading = true; update(); } @@ -729,6 +819,11 @@ abstract class BaseComicPage extends StatelessWidget { Future loadFavorite(T data); + /// 从本地数据源加载漫画信息。 + /// 返回非 null 时,页面将立即渲染本地数据,同时后台继续加载网络数据。 + /// 默认返回 null(保持现有行为,不启用本地加载)。 + Future loadLocalData() async => null; + /// used for history String get id; @@ -791,6 +886,7 @@ abstract class BaseComicPage extends StatelessWidget { _logic.width = constraints.maxWidth; _logic.height = constraints.maxHeight; if (logic.loading) { + logic.loadLocalData = loadLocalData; logic.get(loadData, loadFavorite, () => id); return buildLoading(context); } else if (logic.message != null) { @@ -802,6 +898,14 @@ abstract class BaseComicPage extends StatelessWidget { _logic.thumbnailsData ??= thumbnailsCreator; logic.controller.removeListener(scrollListener); logic.controller.addListener(scrollListener); + + if (logic.networkMessage != null) { + WidgetsBinding.instance.addPostFrameCallback((_) { + showToast(message: logic.networkMessage!); + logic.networkMessage = null; + }); + } + return SmoothCustomScrollView( controller: logic.controller, slivers: [ From e191ed3d30fe883e36bb33fba736e030457e3cae Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 11:16:39 +0800 Subject: [PATCH 02/32] Update comic_page.dart --- lib/pages/comic_page.dart | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/pages/comic_page.dart b/lib/pages/comic_page.dart index 4a17a88fc..9353655a4 100644 --- a/lib/pages/comic_page.dart +++ b/lib/pages/comic_page.dart @@ -183,15 +183,15 @@ class _ComicPageImpl extends BaseComicPage { downloaded.name, downloaded.subTitle, downloaded.cover, - null, - _tagsListToMap(downloaded.tags), + null, // description: 本地无 + _tagsListToMap(downloaded.tags), // tags: 从下载记录恢复 downloaded is CustomDownloadedItem ? (downloaded as CustomDownloadedItem).chapters - : null, - null, - null, + : null, // chapters: 仅 CustomDownloadedItem 有 + null, // thumbnails: 本地无 + null, // thumbnailLoader: 本地无 0, - null, + null, // suggestions: 本地无 sourceKey, id, ); @@ -204,13 +204,13 @@ class _ComicPageImpl extends BaseComicPage { h.title, h.subtitle, h.cover, - null, - {}, - null, - null, - null, + null, // description + {}, // tags: 无 + null, // chapters: 无 + null, // thumbnails + null, // thumbnailLoader 0, - null, + null, // suggestions sourceKey, id, ); From d3a2254cc0efa8030cd78f0bcc05060961dd678d Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 11:56:02 +0800 Subject: [PATCH 03/32] Update comic_page.dart --- lib/pages/comic_page.dart | 189 +++++++++++++++++++------------------- 1 file changed, 95 insertions(+), 94 deletions(-) diff --git a/lib/pages/comic_page.dart b/lib/pages/comic_page.dart index 9353655a4..3a6e01148 100644 --- a/lib/pages/comic_page.dart +++ b/lib/pages/comic_page.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:pica_comic/base.dart'; import 'package:pica_comic/comic_source/comic_source.dart'; +import 'package:pica_comic/network/custom_download_model.dart'; import 'package:pica_comic/components/comment.dart'; import 'package:pica_comic/components/components.dart'; import 'package:pica_comic/components/select_download_eps.dart'; @@ -18,7 +19,6 @@ import 'package:pica_comic/foundation/log.dart'; import 'package:pica_comic/foundation/stack.dart' as stack; import 'package:pica_comic/foundation/ui_mode.dart'; import 'package:pica_comic/network/base_comic.dart'; -import 'package:pica_comic/network/custom_download_model.dart'; import 'package:pica_comic/network/download.dart'; import 'package:pica_comic/network/res.dart'; import 'package:pica_comic/pages/favorites/local_favorites.dart'; @@ -122,55 +122,11 @@ class _ComicPageImpl extends BaseComicPage { } } - @override - EpsData? get eps { - if (data!.chapters != null && data!.chapters!.isNotEmpty) { - return EpsData( - data!.chapters!.values.toList(), - (ep) async { - await History.findOrCreate(data!); - App.globalTo( - () => ComicReadingPage( - CustomReadingData( - data!.target, - data!.title, - ComicSource.find(sourceKey)!, - data!.chapters, - ), - 0, - ep + 1, - ), - ); - }, - ); - } - return null; - } - - @override - String? get introduction => data!.description; - - ComicSource? get comicSource => ComicSource.find(sourceKey); - - @override - Future> loadData() async { - if (comicSource == null) throw "Comic Source Not Found"; - var res = await comicSource!.loadComicInfo!(id); - return res; - } - - @override - Future loadFavorite(ComicInfoData data) async { - bool platformFavorite = data.isFavorite ?? false; - bool localFavorite = LocalFavoritesManager().isExist(id); - return platformFavorite || localFavorite; - } - @override Future loadLocalData() async { final downloadId = DownloadManager().generateId(sourceKey, id); - // 优先级1:已下载的记录(数据最完整:title、cover、tags、可能包含 chapters) + // 优先级1:已下载的记录 DownloadedItem? downloaded; try { if (DownloadManager().isExists(downloadId)) { @@ -197,7 +153,7 @@ class _ComicPageImpl extends BaseComicPage { ); } - // 优先级2:阅读历史(已在 get() 阶段1中查询,存在 _logic.history 中) + // 优先级2:阅读历史(title、cover、subtitle 已在 get() 中查询,存在 _logic.history 中) final h = _logic.history; if (h != null && h.title.isNotEmpty) { return ComicInfoData( @@ -215,7 +171,6 @@ class _ComicPageImpl extends BaseComicPage { id, ); } - return null; } @@ -225,6 +180,53 @@ class _ComicPageImpl extends BaseComicPage { return {"tags": tags}; } + @override + EpsData? get eps { + if (data!.chapters != null && data!.chapters!.isNotEmpty) { + return EpsData( + data!.chapters!.values.toList(), + (ep) async { + await History.findOrCreate(data!); + App.globalTo( + () => ComicReadingPage( + CustomReadingData( + data!.target, + data!.title, + ComicSource.find(sourceKey)!, + data!.chapters, + ), + 0, + ep + 1, + ), + ); + }, + ); + } + return null; + } + + @override + String? get introduction => data!.description; + + ComicSource? get comicSource => ComicSource.find(sourceKey); + + @override + Future> loadData() async { + if (comicSource == null) throw "Comic Source Not Found"; + var res = await comicSource!.loadComicInfo!(id); + return res; + } + + @override + Future loadFavorite(ComicInfoData data) async { + // 平台收藏状态(网络返回),无平台收藏功能的源此值为 null + bool platformFavorite = data.isFavorite ?? false; + // 本地收藏状态(SQLite),isExist() 只按 target 匹配,不受 FavoriteType 不一致影响 + bool localFavorite = LocalFavoritesManager().isExist(id); + // 网络或本地,任意一边为 true → 显示"已收藏" + return platformFavorite || localFavorite; + } + @override int? get pages => null; @@ -660,53 +662,55 @@ class ComicPageLogic extends StateController { bool showFullEps = false; int colorIndex = 0; bool? favoriteOnPlatform; + String? networkMessage;/// 网络加载失败时的信息(有本地数据时网络失败用 toast 展示,不阻塞页面) - /// 网络加载失败时的信息(有本地数据时网络失败用 toast 展示,不阻塞页面) - String? networkMessage; - /// 由 [BaseComicPage] 在首次构建时注入,指向子类的 loadLocalData 方法 - Future Function()? loadLocalData; + Future Function()? loadLocalData;/// 由 [BaseComicPage] 在首次构建时注入,指向子类的 loadLocalData 方法 - void get(Future> Function() loadData, - Future Function(T) loadFavorite, String Function() getId) async { - // ======== 阶段1:加载本地数据和历史 ======== - history = await HistoryManager().find(getId()); +void get(Future> Function() loadData, + Future Function(T) loadFavorite, String Function() getId) async { + // ======== 阶段1:加载本地数据和历史 ======== + history = await HistoryManager().find(getId()); - if (loadLocalData != null) { - var local = await loadLocalData!(); - if (local != null) { - data = local; - favorite = await loadFavorite(local); - loading = false; - update(); - } + if (loadLocalData != null) { + var local = await loadLocalData!(); + if (local != null) { + // 本地有数据,立即展示页面 + data = local; + favorite = await loadFavorite(local); + loading = false; + update(); // ← 页面立即渲染,看到标题、封面、操作按钮 } + } - // ======== 阶段2:加载网络数据 ======== - var [res, _] = await Future.wait( - [loadData(), Future.delayed(const Duration(milliseconds: 300))]); + // ======== 阶段2:加载网络数据 ======== + var [res, _] = await Future.wait( + [loadData(), Future.delayed(const Duration(milliseconds: 300))]); - if (res.error) { - if (data == null) { - message = res.errorMessage; - if (message == "Exit") { - loading = false; - return; - } - } else { - networkMessage = res.errorMessage; + if (res.error) { + if (data == null) { + // 无本地数据 且 网络失败 → 显示错误(现有行为保持) + message = res.errorMessage; + if (message == "Exit") { + loading = false; + return; } } else { - data = res.data; - favorite = await loadFavorite(res.data); - message = null; - networkMessage = null; + // 有本地数据 但 网络失败 → 保留本地数据,仅记录错误 + networkMessage = res.errorMessage; } - - loading = false; - update(); + } else { + // 网络成功 → 用完整数据替换本地数据 + data = res.data; + favorite = await loadFavorite(res.data); + message = null; + networkMessage = null; } + loading = false; + update(); +} + void refresh_() { data = null; message = null; @@ -819,11 +823,6 @@ abstract class BaseComicPage extends StatelessWidget { Future loadFavorite(T data); - /// 从本地数据源加载漫画信息。 - /// 返回非 null 时,页面将立即渲染本地数据,同时后台继续加载网络数据。 - /// 默认返回 null(保持现有行为,不启用本地加载)。 - Future loadLocalData() async => null; - /// used for history String get id; @@ -898,14 +897,12 @@ abstract class BaseComicPage extends StatelessWidget { _logic.thumbnailsData ??= thumbnailsCreator; logic.controller.removeListener(scrollListener); logic.controller.addListener(scrollListener); - if (logic.networkMessage != null) { - WidgetsBinding.instance.addPostFrameCallback((_) { - showToast(message: logic.networkMessage!); - logic.networkMessage = null; - }); + WidgetsBinding.instance.addPostFrameCallback((_) { + showToast(message: logic.networkMessage!); + logic.networkMessage = null; + }); } - return SmoothCustomScrollView( controller: logic.controller, slivers: [ @@ -1785,6 +1782,10 @@ abstract class BaseComicPage extends StatelessWidget { ); } } + /// 从本地数据源加载漫画信息。 + /// 返回非 null 时,页面将立即渲染本地数据,同时后台继续加载网络数据。 + /// 默认返回 null(保持现有行为,不启用本地加载)。 + Future loadLocalData() async => null; } class FavoriteComicWidget extends StatefulWidget { From 47f0a4e72e77f927fba5e6e0805bb048bf1e7944 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 12:54:46 +0800 Subject: [PATCH 04/32] Update comic_page.dart --- lib/pages/comic_page.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pages/comic_page.dart b/lib/pages/comic_page.dart index 3a6e01148..ede647989 100644 --- a/lib/pages/comic_page.dart +++ b/lib/pages/comic_page.dart @@ -19,6 +19,7 @@ import 'package:pica_comic/foundation/log.dart'; import 'package:pica_comic/foundation/stack.dart' as stack; import 'package:pica_comic/foundation/ui_mode.dart'; import 'package:pica_comic/network/base_comic.dart'; +import 'package:pica_comic/network/download_model.dart'; import 'package:pica_comic/network/download.dart'; import 'package:pica_comic/network/res.dart'; import 'package:pica_comic/pages/favorites/local_favorites.dart'; From bc74af93a16c126251be2e9c3d59a6c69d66eea5 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 13:06:45 +0800 Subject: [PATCH 05/32] Update comic_page.dart --- lib/pages/comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/comic_page.dart b/lib/pages/comic_page.dart index ede647989..0879d3d18 100644 --- a/lib/pages/comic_page.dart +++ b/lib/pages/comic_page.dart @@ -139,7 +139,7 @@ class _ComicPageImpl extends BaseComicPage { return ComicInfoData( downloaded.name, downloaded.subTitle, - downloaded.cover, + _logic.history?.cover ?? '', null, // description: 本地无 _tagsListToMap(downloaded.tags), // tags: 从下载记录恢复 downloaded is CustomDownloadedItem From e39fabc1f8fecf1b24e4f71c83c2680060c8774c Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 14:59:47 +0800 Subject: [PATCH 06/32] Update comic_page.dart --- lib/pages/picacg/comic_page.dart | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/pages/picacg/comic_page.dart b/lib/pages/picacg/comic_page.dart index 1ec324790..0708a0054 100644 --- a/lib/pages/picacg/comic_page.dart +++ b/lib/pages/picacg/comic_page.dart @@ -40,7 +40,28 @@ class PicacgComicPage extends BaseComicPage { @override bool get isLiked => data!.isLiked; + + @override + Future loadLocalData() async { + final h = _logic.history; + if (h == null || h.title.isEmpty) return null; + try { + return ComicItem.fromJson({ + "creator": {"id": "", "title": "", "email": "", "name": "", + "level": 0, "exp": 0, "avatarUrl": "", + "frameUrl": null, "isPunched": null, "slogan": null}, + "id": id, + "title": h.title, + "thumbUrl": h.cover, + "description": "", "author": h.subtitle, "chineseTeam": "", + "categories": [], "tags": [], + "likes": 0, "comments": 0, "isLiked": false, "isFavourite": false, + "epsCount": 0, "time": "", "pagesCount": 0 + }); + } catch (_) { return null; } + } + @override void openFavoritePanel() { favoriteComic(FavoriteComicWidget( From 58d8c524e2178b14cbc3253cca1e4ff77e4a48b7 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:00:58 +0800 Subject: [PATCH 07/32] Update eh_gallery_page.dart --- lib/pages/ehentai/eh_gallery_page.dart | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/pages/ehentai/eh_gallery_page.dart b/lib/pages/ehentai/eh_gallery_page.dart index e578df23a..0ba189904 100644 --- a/lib/pages/ehentai/eh_gallery_page.dart +++ b/lib/pages/ehentai/eh_gallery_page.dart @@ -51,7 +51,24 @@ class EhGalleryPage extends BaseComicPage { ), ); }; + + @override + Future loadLocalData() async { + final h = _logic.history; + if (h == null || h.title.isEmpty) return null; + try { + return Gallery.fromJson({ + "title": h.title, "subTitle": h.subtitle, + "type": "", "time": "", "uploader": h.subtitle, + "stars": 0.0, "rating": null, "coverPath": h.cover, + "tags": >{}, "favorite": false, + "link": id, "maxPage": "0", "pageSize": 20, + "ext": "jpg", "width": 100 + }); + } catch (_) { return null; } + } + @override String? get cover => (comicCover ?? data?.coverPath) ?.replaceFirst("s.exhentai.org", "ehgt.org"); From 35acc4a98108f736f9f8ee8a8d471babd289c652 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:04:19 +0800 Subject: [PATCH 08/32] Update jm_comic_page.dart --- lib/pages/jm/jm_comic_page.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/pages/jm/jm_comic_page.dart b/lib/pages/jm/jm_comic_page.dart index e85b578d3..12ec5606a 100644 --- a/lib/pages/jm/jm_comic_page.dart +++ b/lib/pages/jm/jm_comic_page.dart @@ -199,6 +199,22 @@ class JmComicPage extends BaseComicPage { @override String get sourceKey => "jm"; + + + @override + Future loadLocalData() async { + final h = _logic.history; + if (h == null || h.title.isEmpty) return null; + try { + return JmComicInfo.fromMap({ + "name": h.title, "id": id, + "author": [h.subtitle], + "description": "", "series": {}, + "tags": [], "works": [], + "actors": [], "epNames": [] + }); + } catch (_) { return null; } + } } void downloadComic(JmComicInfo comic, BuildContext context) async { From e432dc0c3201a72531cd8e595fb62f102bd47f15 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:05:02 +0800 Subject: [PATCH 09/32] Update hitomi_comic_page.dart --- lib/pages/hitomi/hitomi_comic_page.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/pages/hitomi/hitomi_comic_page.dart b/lib/pages/hitomi/hitomi_comic_page.dart index 0a0084bf3..e23aeb82b 100644 --- a/lib/pages/hitomi/hitomi_comic_page.dart +++ b/lib/pages/hitomi/hitomi_comic_page.dart @@ -210,6 +210,19 @@ class HitomiComicPage extends BaseComicPage { @override String get sourceKey => "hitomi"; + + @override + Future loadLocalData() async { + final h = _logic.history; + if (h == null || h.title.isEmpty) return null; + try { + return HitomiComic( + link, h.title, [], "", [h.subtitle], + "", [], [], [], "", + [], [], h.cover, + ); + } catch (_) { return null; } + } } void _downloadComic( From 63e4887013abbe7f686ff15bd0f299aa273c666d Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:05:47 +0800 Subject: [PATCH 10/32] Update ht_comic_page.dart --- lib/pages/htmanga/ht_comic_page.dart | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/pages/htmanga/ht_comic_page.dart b/lib/pages/htmanga/ht_comic_page.dart index afe3232d3..a568d4460 100644 --- a/lib/pages/htmanga/ht_comic_page.dart +++ b/lib/pages/htmanga/ht_comic_page.dart @@ -177,6 +177,20 @@ class HtComicPage extends BaseComicPage { @override String get sourceKey => 'htmanga'; + + @override + Future loadLocalData() async { + final h = _logic.history; + if (h == null || h.title.isEmpty) return null; + try { + return HtComicInfo.fromJson({ + "id": id, "coverPath": h.cover, "name": h.title, + "category": "", "pages": 0, "tags": {}, + "description": "", "uploader": h.subtitle, + "avatar": "", "uploadNum": 0 + }); + } catch (_) { return null; } + } } class HtComicPageLogic extends StateController { From 1d796fe09d58967107f073d346d25ad8950cb72c Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:09:17 +0800 Subject: [PATCH 11/32] Update comic_page.dart --- lib/pages/nhentai/comic_page.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/pages/nhentai/comic_page.dart b/lib/pages/nhentai/comic_page.dart index d65c2161b..37f8097c5 100644 --- a/lib/pages/nhentai/comic_page.dart +++ b/lib/pages/nhentai/comic_page.dart @@ -244,4 +244,16 @@ class NhentaiComicPage extends BaseComicPage { @override String get sourceKey => 'nhentai'; + + @override + Future loadLocalData() async { + final h = _logic.history; + if (h == null || h.title.isEmpty) return null; + try { + return NhentaiComic.fromMap({ + "id": id, "title": h.title, + "subTitle": h.subtitle, "cover": h.cover, + }); + } catch (_) { return null; } + } } From 3468abfc9d2bb8e4d43a42219e121958b5a94728 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:26:55 +0800 Subject: [PATCH 12/32] Update comic_page.dart --- lib/pages/comic_page.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/pages/comic_page.dart b/lib/pages/comic_page.dart index 0879d3d18..e5f63a004 100644 --- a/lib/pages/comic_page.dart +++ b/lib/pages/comic_page.dart @@ -822,6 +822,8 @@ abstract class BaseComicPage extends StatelessWidget { @nonVirtual set favorite(bool f) => _logic.favorite = f; + History? get pageHistory => _logic.history; + Future loadFavorite(T data); /// used for history From ec24fad1c80340e14f3bd1bddc2718b98cb9b83a Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:27:31 +0800 Subject: [PATCH 13/32] Update comic_page.dart --- lib/pages/picacg/comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/picacg/comic_page.dart b/lib/pages/picacg/comic_page.dart index 0708a0054..6e8d6ec2e 100644 --- a/lib/pages/picacg/comic_page.dart +++ b/lib/pages/picacg/comic_page.dart @@ -43,7 +43,7 @@ class PicacgComicPage extends BaseComicPage { @override Future loadLocalData() async { - final h = _logic.history; + final h = pageHistory; if (h == null || h.title.isEmpty) return null; try { return ComicItem.fromJson({ From 07b756f54cb7b494780ffb0f3478594f4c5620cf Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:28:12 +0800 Subject: [PATCH 14/32] Update eh_gallery_page.dart --- lib/pages/ehentai/eh_gallery_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/ehentai/eh_gallery_page.dart b/lib/pages/ehentai/eh_gallery_page.dart index 0ba189904..990d4c5bf 100644 --- a/lib/pages/ehentai/eh_gallery_page.dart +++ b/lib/pages/ehentai/eh_gallery_page.dart @@ -54,7 +54,7 @@ class EhGalleryPage extends BaseComicPage { @override Future loadLocalData() async { - final h = _logic.history; + final h = pageHistory; if (h == null || h.title.isEmpty) return null; try { return Gallery.fromJson({ From 3809ff4ea4456637be81b32db2ff7447cbc6ef51 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:28:43 +0800 Subject: [PATCH 15/32] Update jm_comic_page.dart --- lib/pages/jm/jm_comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/jm/jm_comic_page.dart b/lib/pages/jm/jm_comic_page.dart index 12ec5606a..567a4b58b 100644 --- a/lib/pages/jm/jm_comic_page.dart +++ b/lib/pages/jm/jm_comic_page.dart @@ -203,7 +203,7 @@ class JmComicPage extends BaseComicPage { @override Future loadLocalData() async { - final h = _logic.history; + final h = pageHistory; if (h == null || h.title.isEmpty) return null; try { return JmComicInfo.fromMap({ From 0fbf55ce46e0db4cdb435c754bdd4e31ba061e88 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:29:16 +0800 Subject: [PATCH 16/32] Update hitomi_comic_page.dart --- lib/pages/hitomi/hitomi_comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/hitomi/hitomi_comic_page.dart b/lib/pages/hitomi/hitomi_comic_page.dart index e23aeb82b..34aa7fa56 100644 --- a/lib/pages/hitomi/hitomi_comic_page.dart +++ b/lib/pages/hitomi/hitomi_comic_page.dart @@ -213,7 +213,7 @@ class HitomiComicPage extends BaseComicPage { @override Future loadLocalData() async { - final h = _logic.history; + final h = pageHistory; if (h == null || h.title.isEmpty) return null; try { return HitomiComic( From cb37132de013611c0a58d8f17405fb05b342452d Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:29:41 +0800 Subject: [PATCH 17/32] Update ht_comic_page.dart --- lib/pages/htmanga/ht_comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/htmanga/ht_comic_page.dart b/lib/pages/htmanga/ht_comic_page.dart index a568d4460..b37002a98 100644 --- a/lib/pages/htmanga/ht_comic_page.dart +++ b/lib/pages/htmanga/ht_comic_page.dart @@ -180,7 +180,7 @@ class HtComicPage extends BaseComicPage { @override Future loadLocalData() async { - final h = _logic.history; + final h = pageHistory; if (h == null || h.title.isEmpty) return null; try { return HtComicInfo.fromJson({ From 4c34893540e60a1b9ebfa85de2fae554b287ce83 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 15:30:15 +0800 Subject: [PATCH 18/32] Update comic_page.dart --- lib/pages/nhentai/comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/nhentai/comic_page.dart b/lib/pages/nhentai/comic_page.dart index 37f8097c5..2c85a01f7 100644 --- a/lib/pages/nhentai/comic_page.dart +++ b/lib/pages/nhentai/comic_page.dart @@ -247,7 +247,7 @@ class NhentaiComicPage extends BaseComicPage { @override Future loadLocalData() async { - final h = _logic.history; + final h = pageHistory; if (h == null || h.title.isEmpty) return null; try { return NhentaiComic.fromMap({ From f68d58f5809e603e16762d6d0dc2a14cc0e49ae3 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:34:02 +0800 Subject: [PATCH 19/32] Update comic_page.dart --- lib/pages/picacg/comic_page.dart | 37 ++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/lib/pages/picacg/comic_page.dart b/lib/pages/picacg/comic_page.dart index 6e8d6ec2e..6b6f56489 100644 --- a/lib/pages/picacg/comic_page.dart +++ b/lib/pages/picacg/comic_page.dart @@ -41,19 +41,44 @@ class PicacgComicPage extends BaseComicPage { @override bool get isLiked => data!.isLiked; - @override +@override Future loadLocalData() async { + String title, cover, subTitle; + bool found = false; final h = pageHistory; - if (h == null || h.title.isEmpty) return null; + if (h != null && h.title.isNotEmpty) { + title = h.title; cover = h.cover; subTitle = h.subtitle; found = true; + } + if (!found) { + try { + final dlId = DownloadManager().generateId(sourceKey, id); + if (DownloadManager().isExists(dlId)) { + final dl = await DownloadManager().getComicOrNull(dlId); + if (dl != null && dl.name.isNotEmpty) { + title = dl.name; subTitle = dl.subTitle; + cover = 'file://${DownloadManager().path}/${DownloadManager().getDirectory(dlId)}/cover.jpg'; + found = true; + } + } + } catch (_) {} + } + if (!found) { + try { + final folders = await LocalFavoritesManager().find(id, const FavoriteType(0)); + if (folders.isNotEmpty) { + final item = LocalFavoritesManager().getComic(folders.first, id, const FavoriteType(0)); + title = item.name; subTitle = item.author; cover = item.coverPath; found = true; + } + } catch (_) {} + } + if (!found) return null; try { return ComicItem.fromJson({ "creator": {"id": "", "title": "", "email": "", "name": "", "level": 0, "exp": 0, "avatarUrl": "", "frameUrl": null, "isPunched": null, "slogan": null}, - "id": id, - "title": h.title, - "thumbUrl": h.cover, - "description": "", "author": h.subtitle, "chineseTeam": "", + "id": id, "title": title, "thumbUrl": cover, + "description": "", "author": subTitle, "chineseTeam": "", "categories": [], "tags": [], "likes": 0, "comments": 0, "isLiked": false, "isFavourite": false, "epsCount": 0, "time": "", "pagesCount": 0 From 52ef36c7ccc07c3f4f6a25302791a91d7a2c0330 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:34:49 +0800 Subject: [PATCH 20/32] Update eh_gallery_page.dart --- lib/pages/ehentai/eh_gallery_page.dart | 35 +++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/lib/pages/ehentai/eh_gallery_page.dart b/lib/pages/ehentai/eh_gallery_page.dart index 990d4c5bf..971a94429 100644 --- a/lib/pages/ehentai/eh_gallery_page.dart +++ b/lib/pages/ehentai/eh_gallery_page.dart @@ -54,13 +54,40 @@ class EhGalleryPage extends BaseComicPage { @override Future loadLocalData() async { + String title, cover, subTitle; + bool found = false; final h = pageHistory; - if (h == null || h.title.isEmpty) return null; + if (h != null && h.title.isNotEmpty) { + title = h.title; cover = h.cover; subTitle = h.subtitle; found = true; + } + if (!found) { + try { + final dlId = DownloadManager().generateId(sourceKey, id); + if (DownloadManager().isExists(dlId)) { + final dl = await DownloadManager().getComicOrNull(dlId); + if (dl != null && dl.name.isNotEmpty) { + title = dl.name; subTitle = dl.subTitle; + cover = 'file://${DownloadManager().path}/${DownloadManager().getDirectory(dlId)}/cover.jpg'; + found = true; + } + } + } catch (_) {} + } + if (!found) { + try { + final folders = await LocalFavoritesManager().find(id, const FavoriteType(1)); + if (folders.isNotEmpty) { + final item = LocalFavoritesManager().getComic(folders.first, id, const FavoriteType(1)); + title = item.name; subTitle = item.author; cover = item.coverPath; found = true; + } + } catch (_) {} + } + if (!found) return null; try { return Gallery.fromJson({ - "title": h.title, "subTitle": h.subtitle, - "type": "", "time": "", "uploader": h.subtitle, - "stars": 0.0, "rating": null, "coverPath": h.cover, + "title": title, "subTitle": subTitle, + "type": "", "time": "", "uploader": subTitle, + "stars": 0.0, "rating": null, "coverPath": cover, "tags": >{}, "favorite": false, "link": id, "maxPage": "0", "pageSize": 20, "ext": "jpg", "width": 100 From 08fb84faa7bcc3caddf7c42057e7a974ba14f63b Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:35:30 +0800 Subject: [PATCH 21/32] Update jm_comic_page.dart --- lib/pages/jm/jm_comic_page.dart | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/pages/jm/jm_comic_page.dart b/lib/pages/jm/jm_comic_page.dart index 567a4b58b..3c9c6df4e 100644 --- a/lib/pages/jm/jm_comic_page.dart +++ b/lib/pages/jm/jm_comic_page.dart @@ -203,12 +203,38 @@ class JmComicPage extends BaseComicPage { @override Future loadLocalData() async { + String title, cover, subTitle; + bool found = false; final h = pageHistory; - if (h == null || h.title.isEmpty) return null; + if (h != null && h.title.isNotEmpty) { + title = h.title; cover = h.cover; subTitle = h.subtitle; found = true; + } + if (!found) { + try { + final dlId = DownloadManager().generateId(sourceKey, id); + if (DownloadManager().isExists(dlId)) { + final dl = await DownloadManager().getComicOrNull(dlId); + if (dl != null && dl.name.isNotEmpty) { + title = dl.name; subTitle = dl.subTitle; + cover = 'file://${DownloadManager().path}/${DownloadManager().getDirectory(dlId)}/cover.jpg'; + found = true; + } + } + } catch (_) {} + } + if (!found) { + try { + final folders = await LocalFavoritesManager().find(id, const FavoriteType(2)); + if (folders.isNotEmpty) { + final item = LocalFavoritesManager().getComic(folders.first, id, const FavoriteType(2)); + title = item.name; subTitle = item.author; cover = item.coverPath; found = true; + } + } catch (_) {} + } + if (!found) return null; try { return JmComicInfo.fromMap({ - "name": h.title, "id": id, - "author": [h.subtitle], + "name": title, "id": id, "author": [subTitle], "description": "", "series": {}, "tags": [], "works": [], "actors": [], "epNames": [] From 0355b5f277cc24ed552d899fba29aa9ddd48f0f5 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:37:28 +0800 Subject: [PATCH 22/32] Update hitomi_comic_page.dart --- lib/pages/hitomi/hitomi_comic_page.dart | 33 ++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/lib/pages/hitomi/hitomi_comic_page.dart b/lib/pages/hitomi/hitomi_comic_page.dart index 34aa7fa56..bfb6cf206 100644 --- a/lib/pages/hitomi/hitomi_comic_page.dart +++ b/lib/pages/hitomi/hitomi_comic_page.dart @@ -213,13 +213,40 @@ class HitomiComicPage extends BaseComicPage { @override Future loadLocalData() async { + String title, cover, subTitle; + bool found = false; final h = pageHistory; - if (h == null || h.title.isEmpty) return null; + if (h != null && h.title.isNotEmpty) { + title = h.title; cover = h.cover; subTitle = h.subtitle; found = true; + } + if (!found) { + try { + final dlId = DownloadManager().generateId(sourceKey, id); + if (DownloadManager().isExists(dlId)) { + final dl = await DownloadManager().getComicOrNull(dlId); + if (dl != null && dl.name.isNotEmpty) { + title = dl.name; subTitle = dl.subTitle; + cover = 'file://${DownloadManager().path}/${DownloadManager().getDirectory(dlId)}/cover.jpg'; + found = true; + } + } + } catch (_) {} + } + if (!found) { + try { + final folders = await LocalFavoritesManager().find(id, const FavoriteType(3)); + if (folders.isNotEmpty) { + final item = LocalFavoritesManager().getComic(folders.first, id, const FavoriteType(3)); + title = item.name; subTitle = item.author; cover = item.coverPath; found = true; + } + } catch (_) {} + } + if (!found) return null; try { return HitomiComic( - link, h.title, [], "", [h.subtitle], + link, title, [], "", [subTitle], "", [], [], [], "", - [], [], h.cover, + [], [], cover, ); } catch (_) { return null; } } From 960b4b86327a1e73796c67c133b83366226db544 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:38:37 +0800 Subject: [PATCH 23/32] Update ht_comic_page.dart --- lib/pages/htmanga/ht_comic_page.dart | 33 +++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/lib/pages/htmanga/ht_comic_page.dart b/lib/pages/htmanga/ht_comic_page.dart index b37002a98..f024fe1dd 100644 --- a/lib/pages/htmanga/ht_comic_page.dart +++ b/lib/pages/htmanga/ht_comic_page.dart @@ -180,13 +180,40 @@ class HtComicPage extends BaseComicPage { @override Future loadLocalData() async { + String title, cover, subTitle; + bool found = false; final h = pageHistory; - if (h == null || h.title.isEmpty) return null; + if (h != null && h.title.isNotEmpty) { + title = h.title; cover = h.cover; subTitle = h.subtitle; found = true; + } + if (!found) { + try { + final dlId = DownloadManager().generateId(sourceKey, id); + if (DownloadManager().isExists(dlId)) { + final dl = await DownloadManager().getComicOrNull(dlId); + if (dl != null && dl.name.isNotEmpty) { + title = dl.name; subTitle = dl.subTitle; + cover = 'file://${DownloadManager().path}/${DownloadManager().getDirectory(dlId)}/cover.jpg'; + found = true; + } + } + } catch (_) {} + } + if (!found) { + try { + final folders = await LocalFavoritesManager().find(id, const FavoriteType(4)); + if (folders.isNotEmpty) { + final item = LocalFavoritesManager().getComic(folders.first, id, const FavoriteType(4)); + title = item.name; subTitle = item.author; cover = item.coverPath; found = true; + } + } catch (_) {} + } + if (!found) return null; try { return HtComicInfo.fromJson({ - "id": id, "coverPath": h.cover, "name": h.title, + "id": id, "coverPath": cover, "name": title, "category": "", "pages": 0, "tags": {}, - "description": "", "uploader": h.subtitle, + "description": "", "uploader": subTitle, "avatar": "", "uploadNum": 0 }); } catch (_) { return null; } From 07fef81b836b5a759009d4ad0ba188067f3e1cff Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:39:25 +0800 Subject: [PATCH 24/32] Update comic_page.dart --- lib/pages/nhentai/comic_page.dart | 33 ++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/lib/pages/nhentai/comic_page.dart b/lib/pages/nhentai/comic_page.dart index 2c85a01f7..8ea3aecf7 100644 --- a/lib/pages/nhentai/comic_page.dart +++ b/lib/pages/nhentai/comic_page.dart @@ -247,12 +247,39 @@ class NhentaiComicPage extends BaseComicPage { @override Future loadLocalData() async { + String title, cover, subTitle; + bool found = false; final h = pageHistory; - if (h == null || h.title.isEmpty) return null; + if (h != null && h.title.isNotEmpty) { + title = h.title; cover = h.cover; subTitle = h.subtitle; found = true; + } + if (!found) { + try { + final dlId = DownloadManager().generateId(sourceKey, id); + if (DownloadManager().isExists(dlId)) { + final dl = await DownloadManager().getComicOrNull(dlId); + if (dl != null && dl.name.isNotEmpty) { + title = dl.name; subTitle = dl.subTitle; + cover = 'file://${DownloadManager().path}/${DownloadManager().getDirectory(dlId)}/cover.jpg'; + found = true; + } + } + } catch (_) {} + } + if (!found) { + try { + final folders = await LocalFavoritesManager().find(id, const FavoriteType(6)); + if (folders.isNotEmpty) { + final item = LocalFavoritesManager().getComic(folders.first, id, const FavoriteType(6)); + title = item.name; subTitle = item.author; cover = item.coverPath; found = true; + } + } catch (_) {} + } + if (!found) return null; try { return NhentaiComic.fromMap({ - "id": id, "title": h.title, - "subTitle": h.subtitle, "cover": h.cover, + "id": id, "title": title, + "subTitle": subTitle, "cover": cover, }); } catch (_) { return null; } } From 7ef9a5b8e146f7feb4f5a6033a496e562df84409 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:44:27 +0800 Subject: [PATCH 25/32] Update comic_page.dart --- lib/pages/picacg/comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/picacg/comic_page.dart b/lib/pages/picacg/comic_page.dart index 6b6f56489..f4f2abdfd 100644 --- a/lib/pages/picacg/comic_page.dart +++ b/lib/pages/picacg/comic_page.dart @@ -43,7 +43,7 @@ class PicacgComicPage extends BaseComicPage { @override Future loadLocalData() async { - String title, cover, subTitle; + String title = '', cover = '', subTitle = ''; bool found = false; final h = pageHistory; if (h != null && h.title.isNotEmpty) { From 99285091f8201be65fbba1d65df228f511c749be Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:44:54 +0800 Subject: [PATCH 26/32] Update eh_gallery_page.dart --- lib/pages/ehentai/eh_gallery_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/ehentai/eh_gallery_page.dart b/lib/pages/ehentai/eh_gallery_page.dart index 971a94429..e110c6958 100644 --- a/lib/pages/ehentai/eh_gallery_page.dart +++ b/lib/pages/ehentai/eh_gallery_page.dart @@ -54,7 +54,7 @@ class EhGalleryPage extends BaseComicPage { @override Future loadLocalData() async { - String title, cover, subTitle; + String title = '', cover = '', subTitle = ''; bool found = false; final h = pageHistory; if (h != null && h.title.isNotEmpty) { From 77023e44d35a7b349d768170bed66553fb40adc7 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:45:18 +0800 Subject: [PATCH 27/32] Update jm_comic_page.dart --- lib/pages/jm/jm_comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/jm/jm_comic_page.dart b/lib/pages/jm/jm_comic_page.dart index 3c9c6df4e..9256c8e28 100644 --- a/lib/pages/jm/jm_comic_page.dart +++ b/lib/pages/jm/jm_comic_page.dart @@ -203,7 +203,7 @@ class JmComicPage extends BaseComicPage { @override Future loadLocalData() async { - String title, cover, subTitle; + String title = '', cover = '', subTitle = ''; bool found = false; final h = pageHistory; if (h != null && h.title.isNotEmpty) { From 4e7169f5d7cca39138a65ee0a0259213c3b5c854 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:45:42 +0800 Subject: [PATCH 28/32] Update hitomi_comic_page.dart --- lib/pages/hitomi/hitomi_comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/hitomi/hitomi_comic_page.dart b/lib/pages/hitomi/hitomi_comic_page.dart index bfb6cf206..f6800998b 100644 --- a/lib/pages/hitomi/hitomi_comic_page.dart +++ b/lib/pages/hitomi/hitomi_comic_page.dart @@ -213,7 +213,7 @@ class HitomiComicPage extends BaseComicPage { @override Future loadLocalData() async { - String title, cover, subTitle; + String title = '', cover = '', subTitle = ''; bool found = false; final h = pageHistory; if (h != null && h.title.isNotEmpty) { From a58f7bd742c1003312ccefeb0b9b2b05b7a2e6c0 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:46:06 +0800 Subject: [PATCH 29/32] Update ht_comic_page.dart --- lib/pages/htmanga/ht_comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/htmanga/ht_comic_page.dart b/lib/pages/htmanga/ht_comic_page.dart index f024fe1dd..0e5684e22 100644 --- a/lib/pages/htmanga/ht_comic_page.dart +++ b/lib/pages/htmanga/ht_comic_page.dart @@ -180,7 +180,7 @@ class HtComicPage extends BaseComicPage { @override Future loadLocalData() async { - String title, cover, subTitle; + String title = '', cover = '', subTitle = ''; bool found = false; final h = pageHistory; if (h != null && h.title.isNotEmpty) { From 30ed67e809e1620f08370442dcebbbebbb923051 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 16:46:37 +0800 Subject: [PATCH 30/32] Update comic_page.dart --- lib/pages/nhentai/comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/nhentai/comic_page.dart b/lib/pages/nhentai/comic_page.dart index 8ea3aecf7..47dc18f4b 100644 --- a/lib/pages/nhentai/comic_page.dart +++ b/lib/pages/nhentai/comic_page.dart @@ -247,7 +247,7 @@ class NhentaiComicPage extends BaseComicPage { @override Future loadLocalData() async { - String title, cover, subTitle; + String title = '', cover = '', subTitle = ''; bool found = false; final h = pageHistory; if (h != null && h.title.isNotEmpty) { From 3f39117bcfd42b6884b5d9c848048c61efaa05d8 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 18:02:42 +0800 Subject: [PATCH 31/32] Update comic_page.dart --- lib/pages/picacg/comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/picacg/comic_page.dart b/lib/pages/picacg/comic_page.dart index f4f2abdfd..d1c82628c 100644 --- a/lib/pages/picacg/comic_page.dart +++ b/lib/pages/picacg/comic_page.dart @@ -81,7 +81,7 @@ class PicacgComicPage extends BaseComicPage { "description": "", "author": subTitle, "chineseTeam": "", "categories": [], "tags": [], "likes": 0, "comments": 0, "isLiked": false, "isFavourite": false, - "epsCount": 0, "time": "", "pagesCount": 0 + "epsCount": 0, "time": "0000-00-00 00:00:00", "pagesCount": 0 }); } catch (_) { return null; } } From d3e7ab0b6159ecc922cd39e53c7ba77aa4b890c8 Mon Sep 17 00:00:00 2001 From: FC383 <229264094+FC383@users.noreply.github.com> Date: Sat, 23 May 2026 18:25:14 +0800 Subject: [PATCH 32/32] Update comic_page.dart --- lib/pages/picacg/comic_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/picacg/comic_page.dart b/lib/pages/picacg/comic_page.dart index d1c82628c..3a1a9a67a 100644 --- a/lib/pages/picacg/comic_page.dart +++ b/lib/pages/picacg/comic_page.dart @@ -41,7 +41,7 @@ class PicacgComicPage extends BaseComicPage { @override bool get isLiked => data!.isLiked; -@override + @override Future loadLocalData() async { String title = '', cover = '', subTitle = ''; bool found = false;