mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
fix(mobile): decode remote thumbnails at displayed size (#29965)
* fix(mobile): decode remote thumbnails at displayed size * use nullable decode size and reuse the tapped thumbnail in the viewer * clean up decode size naming and guards
This commit is contained in:
parent
c52bf9995b
commit
9862e50aab
18 changed files with 386 additions and 71 deletions
|
|
@ -16,6 +16,7 @@ class ThumbnailTile extends ConsumerStatefulWidget {
|
|||
const ThumbnailTile(
|
||||
this.asset, {
|
||||
this.size = kThumbnailResolution,
|
||||
this.remoteSize,
|
||||
this.fit = BoxFit.cover,
|
||||
this.showStorageIndicator = false,
|
||||
this.lockSelection = false,
|
||||
|
|
@ -26,6 +27,9 @@ class ThumbnailTile extends ConsumerStatefulWidget {
|
|||
|
||||
final BaseAsset? asset;
|
||||
final Size size;
|
||||
|
||||
/// Physical size to decode for remote thumbnails.
|
||||
final Size? remoteSize;
|
||||
final BoxFit fit;
|
||||
final bool showStorageIndicator;
|
||||
final bool lockSelection;
|
||||
|
|
@ -108,7 +112,7 @@ class _ThumbnailTileState extends ConsumerState<ThumbnailTile> {
|
|||
// but other solutions have failed thus far.
|
||||
key: ValueKey(isCurrentAsset),
|
||||
tag: '${asset?.heroTag}_$heroIndex',
|
||||
child: Thumbnail.fromAsset(asset: asset, size: widget.size),
|
||||
child: Thumbnail.fromAsset(asset: asset, size: widget.size, remoteSize: widget.remoteSize),
|
||||
// Placeholderbuilder used to hide indicators on first hero animation, since flightShuttleBuilder isn't called until both source and destination hero exist in widget tree.
|
||||
placeholderBuilder: (context, heroSize, child) {
|
||||
if (!_hideIndicators) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue