update reader

This commit is contained in:
2024-12-01 20:22:33 +08:00
committed by nyne
parent 66ebdb03b1
commit c1672d01f8
2 changed files with 19 additions and 7 deletions

View File

@@ -170,14 +170,23 @@ class _GalleryModeState extends State<_GalleryMode>
photoViewControllers[index] = PhotoViewController();
return PhotoViewGalleryPageOptions.customChild(
child: PhotoView.customChild(
key: ValueKey('photo_view_$index'),
if(reader.imagesPerPage == 1) {
return PhotoViewGalleryPageOptions(
filterQuality: FilterQuality.medium,
controller: photoViewControllers[index],
minScale: PhotoViewComputedScale.contained * 1.0,
maxScale: PhotoViewComputedScale.covered * 10.0,
child: buildPageImages(pageImages),
),
imageProvider: _createImageProviderFromKey(pageImages[0], context),
fit: BoxFit.contain,
errorBuilder: (_, error, s, retry) {
return NetworkError(message: error.toString(), retry: retry);
},
);
}
return PhotoViewGalleryPageOptions.customChild(
controller: photoViewControllers[index],
minScale: PhotoViewComputedScale.contained * 1.0,
maxScale: PhotoViewComputedScale.covered * 10.0,
child: buildPageImages(pageImages),
);
}
},