|
@@ -112,15 +112,14 @@ class LibraryPage extends HookConsumerWidget {
|
|
|
onTap: () {
|
|
|
AutoRouter.of(context).push(CreateAlbumRoute(isSharedAlbum: false));
|
|
|
},
|
|
|
- child: Column(
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
- children: [
|
|
|
- LayoutBuilder(
|
|
|
- builder: (context, constraints) {
|
|
|
- return Container(
|
|
|
- width: constraints.maxWidth / 2 - 18,
|
|
|
- height: constraints.maxWidth / 2 - 18,
|
|
|
+ child: Padding(
|
|
|
+ padding: const EdgeInsets.only(bottom: 32),
|
|
|
+ child: Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
decoration: BoxDecoration(
|
|
|
border: Border.all(
|
|
|
color: Colors.grey,
|
|
@@ -134,19 +133,22 @@ class LibraryPage extends HookConsumerWidget {
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
),
|
|
|
),
|
|
|
- );
|
|
|
- }
|
|
|
- ),
|
|
|
- Padding(
|
|
|
- padding: const EdgeInsets.only(top: 8.0),
|
|
|
- child: const Text(
|
|
|
- 'library_page_new_album',
|
|
|
- style: TextStyle(
|
|
|
- fontWeight: FontWeight.bold,
|
|
|
),
|
|
|
- ).tr(),
|
|
|
- )
|
|
|
- ],
|
|
|
+ ),
|
|
|
+ Padding(
|
|
|
+ padding: const EdgeInsets.only(
|
|
|
+ top: 8.0,
|
|
|
+ bottom: 16,
|
|
|
+ ),
|
|
|
+ child: const Text(
|
|
|
+ 'library_page_new_album',
|
|
|
+ style: TextStyle(
|
|
|
+ fontWeight: FontWeight.bold,
|
|
|
+ ),
|
|
|
+ ).tr(),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
);
|
|
|
}
|
|
@@ -189,6 +191,8 @@ class LibraryPage extends HookConsumerWidget {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ final sorted = sortedAlbums();
|
|
|
+
|
|
|
return Scaffold(
|
|
|
appBar: buildAppBar(),
|
|
|
body: CustomScrollView(
|
|
@@ -238,20 +242,33 @@ class LibraryPage extends HookConsumerWidget {
|
|
|
),
|
|
|
),
|
|
|
SliverPadding(
|
|
|
- padding: const EdgeInsets.only(left: 12.0, right: 12, bottom: 50),
|
|
|
- sliver: SliverToBoxAdapter(
|
|
|
- child: Wrap(
|
|
|
- spacing: 12,
|
|
|
- children: [
|
|
|
- buildCreateAlbumButton(),
|
|
|
- for (var album in sortedAlbums())
|
|
|
- AlbumThumbnailCard(
|
|
|
- album: album,
|
|
|
+ padding: const EdgeInsets.all(12.0),
|
|
|
+ sliver: SliverGrid(
|
|
|
+ gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
|
|
|
+ maxCrossAxisExtent: 250,
|
|
|
+ mainAxisSpacing: 12,
|
|
|
+ crossAxisSpacing: 12,
|
|
|
+ childAspectRatio: .7,
|
|
|
+ ),
|
|
|
+ delegate: SliverChildBuilderDelegate(
|
|
|
+ childCount: sorted.length + 1,
|
|
|
+ (context, index) {
|
|
|
+ if (index == 0) {
|
|
|
+ return buildCreateAlbumButton();
|
|
|
+ }
|
|
|
+
|
|
|
+ return AlbumThumbnailCard(
|
|
|
+ album: sorted[index - 1],
|
|
|
+ onTap: () => AutoRouter.of(context).push(
|
|
|
+ AlbumViewerRoute(
|
|
|
+ albumId: sorted[index - 1].id,
|
|
|
+ ),
|
|
|
),
|
|
|
- ],
|
|
|
+ );
|
|
|
+ },
|
|
|
),
|
|
|
),
|
|
|
- )
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
);
|