fix: image loading progress

This commit is contained in:
bggRGjQaUbCoE
2024-09-07 19:48:45 +08:00
parent cc56705714
commit 755a93364b

View File

@@ -155,6 +155,8 @@ class _ImagePreviewState extends State<ImagePreview>
widget.imgList![index], widget.imgList![index],
fit: BoxFit.contain, fit: BoxFit.contain,
mode: ExtendedImageMode.gesture, mode: ExtendedImageMode.gesture,
handleLoadingProgress: true,
clearMemoryCacheWhenDispose: true,
onDoubleTap: (ExtendedImageGestureState state) { onDoubleTap: (ExtendedImageGestureState state) {
final Offset? pointerDownPosition = final Offset? pointerDownPosition =
state.pointerDownPosition; state.pointerDownPosition;
@@ -214,9 +216,7 @@ class _ImagePreviewState extends State<ImagePreview>
SizedBox( SizedBox(
width: 150.0, width: 150.0,
child: LinearProgressIndicator( child: LinearProgressIndicator(
value: progress, value: progress ?? 0),
color: Colors.white,
),
), ),
// const SizedBox(height: 10.0), // const SizedBox(height: 10.0),
// Text('${((progress ?? 0.0) * 100).toInt()}%',), // Text('${((progress ?? 0.0) * 100).toInt()}%',),