mobile: wrap thumbnail image with renderboundary

This commit is contained in:
shalong-tanwen 2023-10-23 13:55:10 +05:30
parent ce2ecbea40
commit 9e63554889
2 changed files with 22 additions and 20 deletions

View file

@ -142,24 +142,26 @@ class ImmichAssetGridViewState extends State<ImmichAssetGridView> {
) {
return isScrolling
? _getPlaceholder(asset)
: ThumbnailImage(
asset: asset,
index: index,
loadAsset: widget.renderList.loadAsset,
totalAssets: widget.renderList.totalAssets,
multiselectEnabled: widget.selectionActive,
isSelected:
widget.selectionActive && _selectedAssets.contains(asset),
onSelect: () => _selectAssets([asset]),
onDeselect: widget.canDeselect ||
widget.preselectedAssets == null ||
!widget.preselectedAssets!.contains(asset)
? () => _deselectAssets([asset])
: null,
useGrayBoxPlaceholder: true,
showStorageIndicator: widget.showStorageIndicator,
heroOffset: widget.heroOffset,
showStack: widget.showStack,
: RepaintBoundary(
child: ThumbnailImage(
asset: asset,
index: index,
loadAsset: widget.renderList.loadAsset,
totalAssets: widget.renderList.totalAssets,
multiselectEnabled: widget.selectionActive,
isSelected:
widget.selectionActive && _selectedAssets.contains(asset),
onSelect: () => _selectAssets([asset]),
onDeselect: widget.canDeselect ||
widget.preselectedAssets == null ||
!widget.preselectedAssets!.contains(asset)
? () => _deselectAssets([asset])
: null,
useGrayBoxPlaceholder: true,
showStorageIndicator: widget.showStorageIndicator,
heroOffset: widget.heroOffset,
showStack: widget.showStack,
),
);
}

View file

@ -123,8 +123,8 @@ class ImmichImage extends StatelessWidget {
cacheKey: getThumbnailCacheKey(asset, type: type),
),
fit: fit,
duration: const Duration(milliseconds: 500),
syncDuration: const Duration(milliseconds: 500),
duration: const Duration(milliseconds: 300),
syncDuration: const Duration(milliseconds: 300),
placeholder: placeholderWidget,
errorBuilder: (context, error) {
if (error is HttpExceptionWithStatus &&