mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-03-25 00:14:42 +01:00
Hide thumbnail after large image loaded in viewer
This commit is contained in:
parent
1926bdd8a6
commit
c8f761285c
1 changed files with 28 additions and 25 deletions
|
@ -136,32 +136,35 @@ class _RemoteImageViewerState extends State<RemoteImageViewer> {
|
||||||
child: Stack(
|
child: Stack(
|
||||||
fit: StackFit.expand,
|
fit: StackFit.expand,
|
||||||
children: [
|
children: [
|
||||||
Hero(
|
Opacity(
|
||||||
tag: flutter_util.getImageHeroTag(widget.file),
|
opacity: !_isHeroDone || !_isLoaded ? 1 : 0,
|
||||||
flightShuttleBuilder: (flightContext, animation, flightDirection,
|
child: Hero(
|
||||||
fromHeroContext, toHeroContext) {
|
tag: flutter_util.getImageHeroTag(widget.file),
|
||||||
_isHeroDone = false;
|
flightShuttleBuilder: (flightContext, animation, flightDirection,
|
||||||
animation.addStatusListener(_animationListener);
|
fromHeroContext, toHeroContext) {
|
||||||
return flutter_util.defaultHeroFlightShuttleBuilder(
|
_isHeroDone = false;
|
||||||
flightContext,
|
animation.addStatusListener(_animationListener);
|
||||||
animation,
|
return flutter_util.defaultHeroFlightShuttleBuilder(
|
||||||
flightDirection,
|
flightContext,
|
||||||
fromHeroContext,
|
animation,
|
||||||
toHeroContext,
|
flightDirection,
|
||||||
);
|
fromHeroContext,
|
||||||
},
|
toHeroContext,
|
||||||
child: CachedNetworkImage(
|
);
|
||||||
fit: BoxFit.contain,
|
|
||||||
cacheManager: ThumbnailCacheManager.inst,
|
|
||||||
imageUrl: NetworkRectThumbnail.imageUrlForFile(
|
|
||||||
widget.account, widget.file),
|
|
||||||
httpHeaders: {
|
|
||||||
"Authorization":
|
|
||||||
AuthUtil.fromAccount(widget.account).toHeaderValue(),
|
|
||||||
},
|
},
|
||||||
fadeInDuration: const Duration(),
|
child: CachedNetworkImage(
|
||||||
filterQuality: FilterQuality.high,
|
fit: BoxFit.contain,
|
||||||
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
|
cacheManager: ThumbnailCacheManager.inst,
|
||||||
|
imageUrl: NetworkRectThumbnail.imageUrlForFile(
|
||||||
|
widget.account, widget.file),
|
||||||
|
httpHeaders: {
|
||||||
|
"Authorization":
|
||||||
|
AuthUtil.fromAccount(widget.account).toHeaderValue(),
|
||||||
|
},
|
||||||
|
fadeInDuration: const Duration(),
|
||||||
|
filterQuality: FilterQuality.high,
|
||||||
|
imageRenderMethodForWeb: ImageRenderMethodForWeb.HttpGet,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (_isHeroDone)
|
if (_isHeroDone)
|
||||||
|
|
Loading…
Add table
Reference in a new issue