photo_view
photo_view copied to clipboard
Strange swiping experience release build vs. debug build
I am using the latest version of PhotoViewGallery to show images loading from network which is sometimes slow.
I noticed that in debug build, swiping is smooth: if the next image is not yet fully loaded, it shows black but the swiping is smooth. In release build, when the next image is not yet fully loaded, swiping just stale, and after image is loaded it suddenly starts to move.
The code is trivial. Note that I am not using NetworkImage for some irrelevant reasons.
return PhotoViewGallery.builder(
scrollPhysics: const BouncingScrollPhysics(),
builder: (BuildContext context, int index) {
var bytes = ... // loaded from remote
return PhotoViewGalleryPageOptions(
imageProvider: MemoryImage(Uint8List.fromList(bytes)),
initialScale: PhotoViewComputedScale.contained,
minScale: PhotoViewComputedScale.contained * 0.5,
maxScale: PhotoViewComputedScale.covered * 2.0,
heroAttributes:
PhotoViewHeroAttributes(tag: 'image'),
);
},
itemCount: size,
);
Any idea why?