refactor: use listview to render shared albums

This commit is contained in:
shalong-tanwen 2023-12-06 15:18:58 +05:30
parent 4a87ec1b04
commit 1ce65b39fb
2 changed files with 14 additions and 8 deletions

View file

@ -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])
: () {},
),
),
],
),
);
}

View file

@ -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,