Add HistoryImageProvider

This commit is contained in:
2024-12-02 11:19:06 +08:00
committed by nyne
parent 035a84380c
commit 21bf9d72c0
6 changed files with 111 additions and 44 deletions

View File

@@ -78,33 +78,7 @@ class _HistoryPageState extends State<HistoryPage> {
],
),
SliverGridComics(
comics: comics.map(
(e) {
var cover = e.cover;
if (!cover.isURL) {
var localComic = LocalManager().find(
e.id,
e.type,
);
if(localComic != null) {
cover = "file://${localComic.coverFile.path}";
}
}
return Comic(
e.title,
cover,
e.id,
e.subtitle,
null,
getDescription(e),
e.type == ComicType.local
? 'local'
: e.type.comicSource?.key ?? "Unknown:${e.type.value}",
null,
null,
);
},
).toList(),
comics: comics,
badgeBuilder: (c) {
return ComicSource.find(c.sourceKey)?.name;
},