mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Customization options for asset grid (#498)
* Add settings options for number of assets per row and storage indicator * Add attributes to enum to avoid duplicate code * Also apply customizations to albums * Minor Refactorings * Three stage loading i18n fix
This commit is contained in:
parent
07b58f46f9
commit
013a0f8324
13 changed files with 209 additions and 64 deletions
|
|
@ -7,11 +7,15 @@ import 'package:openapi/api.dart';
|
|||
class ImageGrid extends ConsumerWidget {
|
||||
final List<AssetResponseDto> assetGroup;
|
||||
final List<AssetResponseDto> sortedAssetGroup;
|
||||
final int tilesPerRow;
|
||||
final bool showStorageIndicator;
|
||||
|
||||
ImageGrid({
|
||||
Key? key,
|
||||
required this.assetGroup,
|
||||
required this.sortedAssetGroup,
|
||||
this.tilesPerRow = 4,
|
||||
this.showStorageIndicator = true,
|
||||
}) : super(key: key);
|
||||
|
||||
List<AssetResponseDto> imageSortedList = [];
|
||||
|
|
@ -19,8 +23,8 @@ class ImageGrid extends ConsumerWidget {
|
|||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
return SliverGrid(
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4,
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: tilesPerRow,
|
||||
crossAxisSpacing: 5.0,
|
||||
mainAxisSpacing: 5,
|
||||
),
|
||||
|
|
@ -34,6 +38,7 @@ class ImageGrid extends ConsumerWidget {
|
|||
ThumbnailImage(
|
||||
asset: assetGroup[index],
|
||||
assetList: sortedAssetGroup,
|
||||
showStorageIndicator: showStorageIndicator,
|
||||
),
|
||||
if (assetType != AssetTypeEnum.IMAGE)
|
||||
Positioned(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue