Fix weired positioning of Stack children in image viewer

This commit is contained in:
Ming Ming 2023-06-03 22:08:45 +08:00
parent 7a8b59bcff
commit a928338fa6

View file

@ -134,7 +134,7 @@ class _RemoteImageViewerState extends State<RemoteImageViewer> {
onZoomStarted: widget.onZoomStarted, onZoomStarted: widget.onZoomStarted,
onZoomEnded: widget.onZoomEnded, onZoomEnded: widget.onZoomEnded,
child: Stack( child: Stack(
fit: StackFit.passthrough, fit: StackFit.expand,
children: [ children: [
Hero( Hero(
tag: flutter_util.getImageHeroTag(widget.file), tag: flutter_util.getImageHeroTag(widget.file),
@ -166,13 +166,13 @@ class _RemoteImageViewerState extends State<RemoteImageViewer> {
), ),
if (_isHeroDone) if (_isHeroDone)
mod.CachedNetworkImage( mod.CachedNetworkImage(
fit: BoxFit.contain,
cacheManager: LargeImageCacheManager.inst, cacheManager: LargeImageCacheManager.inst,
imageUrl: _getImageUrl(widget.account, widget.file), imageUrl: _getImageUrl(widget.account, widget.file),
httpHeaders: { httpHeaders: {
"Authorization": "Authorization":
AuthUtil.fromAccount(widget.account).toHeaderValue(), AuthUtil.fromAccount(widget.account).toHeaderValue(),
}, },
fit: BoxFit.contain,
fadeInDuration: const Duration(), fadeInDuration: const Duration(),
filterQuality: FilterQuality.high, filterQuality: FilterQuality.high,
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet, imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,