Quellcode durchsuchen

Added 'New album' AlbumListItem in CreateCollectionSheet

ashilkn vor 2 Jahren
Ursprung
Commit
4229f32f55
1 geänderte Dateien mit 11 neuen und 2 gelöschten Zeilen
  1. 11 2
      lib/ui/create_collection_sheet.dart

+ 11 - 2
lib/ui/create_collection_sheet.dart

@@ -142,8 +142,17 @@ class _CreateCollectionSheetState extends State<CreateCollectionSheet> {
                                         .data as List<CollectionWithThumbnail>;
                                     return ListView.separated(
                                       itemBuilder: (context, index) {
+                                        if (index == 0) {
+                                          return GestureDetector(
+                                            onTap: () {},
+                                            behavior: HitTestBehavior.opaque,
+                                            child: const AlbumListItemWidget(
+                                              isNew: true,
+                                            ),
+                                          );
+                                        }
                                         final item =
-                                            collectionsWithThumbnail[index];
+                                            collectionsWithThumbnail[index - 1];
                                         return GestureDetector(
                                           behavior: HitTestBehavior.opaque,
                                           onTap: () =>
@@ -161,7 +170,7 @@ class _CreateCollectionSheetState extends State<CreateCollectionSheet> {
                                         height: 8,
                                       ),
                                       itemCount:
-                                          collectionsWithThumbnail.length,
+                                          collectionsWithThumbnail.length + 1,
                                       shrinkWrap: true,
                                       physics: const BouncingScrollPhysics(),
                                     );