From 1ce65b39fb7f1b6fea3b4db1fdc1fa99c49105f8 Mon Sep 17 00:00:00 2001 From: shalong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:18:58 +0530 Subject: [PATCH] refactor: use listview to render shared albums --- .../album/ui/add_to_album_sliverlist.dart | 21 ++++++++++++------- .../album/ui/album_thumbnail_card.dart | 1 + 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/mobile/lib/modules/album/ui/add_to_album_sliverlist.dart b/mobile/lib/modules/album/ui/add_to_album_sliverlist.dart index 226047ca2..caa798a90 100644 --- a/mobile/lib/modules/album/ui/add_to_album_sliverlist.dart +++ b/mobile/lib/modules/album/ui/add_to_album_sliverlist.dart @@ -40,14 +40,19 @@ class AddToAlbumSliverList extends HookConsumerWidget { title: Text('common_shared'.tr()), tilePadding: const EdgeInsets.symmetric(horizontal: 10.0), leading: const Icon(Icons.group), - children: sortedSharedAlbums - .map( - (album) => AlbumThumbnailListTile( - album: album, - onTap: enabled ? () => onAddToAlbum(album) : () {}, - ), - ) - .toList(), + children: [ + ListView.builder( + shrinkWrap: true, + physics: const ClampingScrollPhysics(), + itemCount: sortedSharedAlbums.length, + itemBuilder: (context, index) => AlbumThumbnailListTile( + album: sortedSharedAlbums[index], + onTap: enabled + ? () => onAddToAlbum(sortedSharedAlbums[index]) + : () {}, + ), + ), + ], ), ); } diff --git a/mobile/lib/modules/album/ui/album_thumbnail_card.dart b/mobile/lib/modules/album/ui/album_thumbnail_card.dart index b295deec5..1ef032d55 100644 --- a/mobile/lib/modules/album/ui/album_thumbnail_card.dart +++ b/mobile/lib/modules/album/ui/album_thumbnail_card.dart @@ -110,6 +110,7 @@ class AlbumThumbnailCard extends StatelessWidget { width: cardSize, child: Text( album.name, + overflow: TextOverflow.ellipsis, style: context.textTheme.bodyMedium?.copyWith( color: context.primaryColor, fontWeight: FontWeight.w500,