mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
update illust page
This commit is contained in:
@@ -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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user