update illust page

This commit is contained in:
wgh19
2024-05-13 22:47:34 +08:00
parent 2045dd0741
commit e095a47002

View File

@@ -94,11 +94,31 @@ class _IllustPageState extends State<IllustPage> {
height: imageHeight, height: imageHeight,
child: GestureDetector( child: GestureDetector(
onTap: () => ImagePage.show(widget.illust.images[index].original), onTap: () => ImagePage.show(widget.illust.images[index].original),
child: AnimatedImage( child: Image(
image: CachedImageProvider(widget.illust.images[index].medium), image: CachedImageProvider(widget.illust.images[index].large),
width: imageWidth, width: imageWidth,
fit: BoxFit.cover, fit: BoxFit.cover,
height: imageHeight, height: imageHeight,
loadingBuilder: (context, child, loadingProgress) {
if (loadingProgress == null) return child;
double? value;
if(loadingProgress.expectedTotalBytes != null) {
value = (loadingProgress.cumulativeBytesLoaded /
loadingProgress.expectedTotalBytes!)*100;
}
if(value != null && (value > 100 || value < 0)) {
value = null;
}
return Center(
child: SizedBox(
width: 24,
height: 24,
child: ProgressRing(
value: value,
),
),
);
}
), ),
), ),
); );