1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-28 06:32:44 +01:00

chore(mobile): thumbnail image ui improvements ()

improve ui for thumbnail image

Co-authored-by: dvbthien <dvbthien@gmail.com>
This commit is contained in:
dvbthien 2024-10-22 04:36:15 +07:00 committed by GitHub
parent 21d7cf6de6
commit 16f2364e93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -138,10 +138,31 @@ class ThumbnailImage extends ConsumerWidget {
tag: isFromDto tag: isFromDto
? '${asset.remoteId}-$heroOffset' ? '${asset.remoteId}-$heroOffset'
: asset.id + heroOffset, : asset.id + heroOffset,
child: ImmichThumbnail( child: Stack(
asset: asset, children: [
height: 250, ImmichThumbnail(
width: 250, asset: asset,
height: 250,
width: 250,
),
Container(
height: 250,
width: 250,
decoration: const BoxDecoration(
gradient: LinearGradient(
colors: [
Color.fromRGBO(0, 0, 0, 0.1),
Colors.transparent,
Colors.transparent,
Color.fromRGBO(0, 0, 0, 0.1),
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
stops: [0, 0.3, 0.6, 1],
),
),
),
],
), ),
), ),
); );
@ -153,11 +174,8 @@ class ThumbnailImage extends ConsumerWidget {
color: canDeselect ? assetContainerColor : Colors.grey, color: canDeselect ? assetContainerColor : Colors.grey,
), ),
child: ClipRRect( child: ClipRRect(
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.all(
topRight: Radius.circular(15.0), Radius.circular(15.0),
bottomRight: Radius.circular(15.0),
bottomLeft: Radius.circular(15.0),
topLeft: Radius.zero,
), ),
child: image, child: image,
), ),
@ -177,7 +195,33 @@ class ThumbnailImage extends ConsumerWidget {
) )
: const Border(), : const Border(),
), ),
child: buildImage(), child: Stack(
children: [
buildImage(),
if (showStorageIndicator)
Positioned(
right: 8,
bottom: 5,
child: Icon(
storageIcon(asset),
color: Colors.white.withOpacity(.8),
size: 16,
),
),
if (asset.isFavorite)
const Positioned(
left: 8,
bottom: 5,
child: Icon(
Icons.favorite,
color: Colors.white,
size: 16,
),
),
if (!asset.isImage) buildVideoIcon(),
if (asset.stackCount > 0) buildStackIcon(),
],
),
), ),
if (multiselectEnabled) if (multiselectEnabled)
Padding( Padding(
@ -187,28 +231,6 @@ class ThumbnailImage extends ConsumerWidget {
child: buildSelectionIcon(asset), child: buildSelectionIcon(asset),
), ),
), ),
if (showStorageIndicator)
Positioned(
right: 8,
bottom: 5,
child: Icon(
storageIcon(asset),
color: Colors.white.withOpacity(.8),
size: 16,
),
),
if (asset.isFavorite)
const Positioned(
left: 8,
bottom: 5,
child: Icon(
Icons.favorite,
color: Colors.white,
size: 18,
),
),
if (!asset.isImage) buildVideoIcon(),
if (asset.stackCount > 0) buildStackIcon(),
], ],
); );
} }