From 6e77e5d27c76574a8aa70ebd687f57946493eea8 Mon Sep 17 00:00:00 2001 From: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Date: Fri, 16 Feb 2024 08:06:30 +0530 Subject: [PATCH] chore: rebase on main --- mobile/lib/shared/ui/immich_image.dart | 62 +------------------------- 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/mobile/lib/shared/ui/immich_image.dart b/mobile/lib/shared/ui/immich_image.dart index 205b868e4284e..70d3fd7b3ffe7 100644 --- a/mobile/lib/shared/ui/immich_image.dart +++ b/mobile/lib/shared/ui/immich_image.dart @@ -101,64 +101,6 @@ class ImmichImage extends StatefulWidget { static bool useLocal(Asset asset) => !asset.isRemote || asset.isLocal && !Store.get(StoreKey.preferRemoteImage, false); - @override - Widget build(BuildContext context) { - - if (asset == null) { - return Container( - decoration: const BoxDecoration( - color: Colors.grey, - ), - child: SizedBox( - width: width, - height: height, - child: const Center( - child: Icon(Icons.no_photography), - ), - ), - ); - } - - return OctoImage( - fadeInDuration: const Duration(milliseconds: 0), - fadeOutDuration: const Duration(milliseconds: 400), - placeholderBuilder: (context) { - if (useGrayBoxPlaceholder) { - // Use the gray box placeholder - return const SizedBox.expand( - child: DecoratedBox( - decoration: BoxDecoration(color: Colors.grey), - ), - ); - } - // No placeholder - return const SizedBox(); - }, - image: ImmichImage.imageProvider( - asset: asset, - isThumbnail: isThumbnail, - ), - width: width, - height: height, - fit: fit, - errorBuilder: (context, error, stackTrace) { - if (error is PlatformException && - error.code == "The asset not found!") { - debugPrint( - "Asset ${asset?.localId} does not exist anymore on device!", - ); - } else { - debugPrint( - "Error getting thumb for assetId=${asset?.localId}: $error", - ); - } - return Icon( - Icons.image_not_supported_outlined, - color: context.primaryColor, - ); - }, - ); - } } /// Renders an Asset using local data if available, else remote data @@ -197,8 +139,8 @@ class _ImmichImageState extends State { final Asset asset = widget.asset!; return OctoImage( - fadeInDuration: const Duration(milliseconds: 200), - fadeOutDuration: const Duration(milliseconds: 200), + fadeInDuration: const Duration(milliseconds: 0), + fadeOutDuration: const Duration(milliseconds: 400), placeholderBuilder: (context) { if (thumbHashBytes != null && widget.isThumbnail) { // Use the blurhash placeholder