Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Add CollectionLinkBadge widget and integrate it into MemoryLinkAlbumItem and QuickLinkAlbumItem for enhanced UI

AmanRajSinghMourya2b60398eb6d6
diff --git a/mobile/apps/photos/lib/ui/components/collection_share_badge.dart b/mobile/apps/photos/lib/ui/components/collection_share_badge.dart
index c05fa15f82..c7c6c8bc06 100644
--- a/mobile/apps/photos/lib/ui/components/collection_share_badge.dart
+++ b/mobile/apps/photos/lib/ui/components/collection_share_badge.dart
@@ -136,6 +136,35 @@ class CollectionShareBadge extends StatelessWidget {
}
}
+class CollectionLinkBadge extends StatelessWidget {
+ const CollectionLinkBadge({super.key});
+
+ @override
+ Widget build(BuildContext context) {
+ final colorScheme = getEnteColorScheme(context);
+ return Container(
+ width: kCollectionBadgeSize,
+ height: kCollectionBadgeSize,
+ decoration: BoxDecoration(
+ color: colorScheme.greenBase,
+ shape: BoxShape.circle,
+ border: Border.all(
+ color: colorScheme.fill,
+ width: kCollectionBadgeBorderWidth,
+ ),
+ ),
+ child: const Center(
+ child: HugeIcon(
+ icon: HugeIcons.strokeRoundedLink02,
+ strokeWidth: kCollectionBadgeStrokeWidth,
+ color: Colors.white,
+ size: kCollectionBadgeIconSize,
+ ),
+ ),
+ );
+ }
+}
+
class CollectionUnSyncedBadge extends StatelessWidget {
static const Color _backgroundColor = Color.fromRGBO(242, 72, 34, 1);
diff --git a/mobile/apps/photos/lib/ui/tabs/shared/memory_link_item.dart b/mobile/apps/photos/lib/ui/tabs/shared/memory_link_item.dart
index c1dc571766..8770f1b8e7 100644
--- a/mobile/apps/photos/lib/ui/tabs/shared/memory_link_item.dart
+++ b/mobile/apps/photos/lib/ui/tabs/shared/memory_link_item.dart
@@ -72,29 +72,39 @@ class MemoryLinkAlbumItem extends StatelessWidget {
SizedBox(
width: _thumbSize,
height: _thumbSize,
- child: FutureBuilder<EnteFile?>(
- future: _loadPreviewFile(),
- builder: (context, snapshot) {
- if (snapshot.hasData && snapshot.data != null) {
- final String heroTag =
- heroTagPrefix + snapshot.data!.tag;
- return Hero(
- tag: heroTag,
- child: ClipRRect(
- borderRadius:
- BorderRadius.circular(_cornerRadius),
- child: ThumbnailWidget(
- snapshot.data!,
- key: ValueKey(heroTag),
- ),
- ),
- );
- }
- return const NoThumbnailWidget(
- addBorder: false,
- borderRadius: _cornerRadius,
- );
- },
+ child: Stack(
+ clipBehavior: Clip.none,
+ children: [
+ FutureBuilder<EnteFile?>(
+ future: _loadPreviewFile(),
+ builder: (context, snapshot) {
+ if (snapshot.hasData && snapshot.data != null) {
+ final String heroTag =
+ heroTagPrefix + snapshot.data!.tag;
+ return Hero(
+ tag: heroTag,
+ child: ClipRRect(
+ borderRadius:
+ BorderRadius.circular(_cornerRadius),
+ child: ThumbnailWidget(
+ snapshot.data!,
+ key: ValueKey(heroTag),
+ ),
+ ),
+ );
+ }
+ return const NoThumbnailWidget(
+ addBorder: false,
+ borderRadius: _cornerRadius,
+ );
+ },
+ ),
+ const Positioned(
+ right: -4,
+ bottom: -4,
+ child: CollectionLinkBadge(),
+ ),
+ ],
),
),
const SizedBox(width: 12),
diff --git a/mobile/apps/photos/lib/ui/tabs/shared/quick_link_album_item.dart b/mobile/apps/photos/lib/ui/tabs/shared/quick_link_album_item.dart
index da227461e8..ef0da26dcb 100644
--- a/mobile/apps/photos/lib/ui/tabs/shared/quick_link_album_item.dart
+++ b/mobile/apps/photos/lib/ui/tabs/shared/quick_link_album_item.dart
@@ -52,29 +52,40 @@ class QuickLinkAlbumItem extends StatelessWidget {
SizedBox(
width: _thumbSize,
height: _thumbSize,
- child: FutureBuilder<EnteFile?>(
- future: CollectionsService.instance.getCover(c),
- builder: (context, snapshot) {
- if (snapshot.hasData) {
- final String heroTag =
- heroTagPrefix + snapshot.data!.tag;
- return Hero(
- tag: heroTag,
- child: ClipRRect(
- borderRadius: BorderRadius.circular(_cornerRadius),
- child: ThumbnailWidget(
- snapshot.data!,
- key: ValueKey(heroTag),
- ),
- ),
- );
- } else {
- return const NoThumbnailWidget(
- addBorder: false,
- borderRadius: _cornerRadius,
- );
- }
- },
+ child: Stack(
+ clipBehavior: Clip.none,
+ children: [
+ FutureBuilder<EnteFile?>(
+ future: CollectionsService.instance.getCover(c),
+ builder: (context, snapshot) {
+ if (snapshot.hasData) {
+ final String heroTag =
+ heroTagPrefix + snapshot.data!.tag;
+ return Hero(
+ tag: heroTag,
+ child: ClipRRect(
+ borderRadius:
+ BorderRadius.circular(_cornerRadius),
+ child: ThumbnailWidget(
+ snapshot.data!,
+ key: ValueKey(heroTag),
+ ),
+ ),
+ );
+ } else {
+ return const NoThumbnailWidget(
+ addBorder: false,
+ borderRadius: _cornerRadius,
+ );
+ }
+ },
+ ),
+ const Positioned(
+ right: -4,
+ bottom: -4,
+ child: CollectionLinkBadge(),
+ ),
+ ],
),
),
const SizedBox(width: 12),