Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-01-24 18:07:08 +08:00
parent 68872f7b14
commit e9b5cffa91
18 changed files with 326 additions and 366 deletions

View File

@@ -175,17 +175,24 @@ class DetailItem extends StatelessWidget {
final cover = File(
path.join(entry.entryDirPath, PathUtils.coverName),
);
final maxWidth = constraints.maxWidth;
final maxHeight = constraints.maxHeight;
int? cacheWidth, cacheHeight;
if (entry.pageData?.cacheWidth ?? false) {
cacheWidth = maxWidth.cacheSize(context);
} else {
cacheHeight = maxHeight.cacheSize(context);
}
return cover.existsSync()
? ClipRRect(
borderRadius: StyleString.mdRadius,
child: Image.file(
cover,
width: constraints.maxWidth,
height: constraints.maxHeight,
width: maxWidth,
height: maxHeight,
fit: BoxFit.cover,
cacheHeight: constraints.maxWidth.cacheSize(
context,
),
cacheWidth: cacheWidth,
cacheHeight: cacheHeight,
colorBlendMode: NetworkImgLayer.reduce
? BlendMode.modulate
: null,
@@ -196,8 +203,9 @@ class DetailItem extends StatelessWidget {
)
: NetworkImgLayer(
src: entry.cover,
width: constraints.maxWidth,
height: constraints.maxHeight,
width: maxWidth,
height: maxHeight,
cacheWidth: entry.pageData?.cacheWidth,
);
},
),