From b9b197bc15edeb4015993556561ddb1310885220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=85=B1=E5=A4=A9=E5=B0=8F=E7=A6=BD=E5=85=BD?= Date: Wed, 31 May 2023 00:29:44 +0800 Subject: [PATCH] v7.2.0+129 --- lib/src/config/ui_config.dart | 2 + .../archive/archive_list_download_page.dart | 54 ++++++++--------- .../gallery/gallery_list_download_page.dart | 60 +++++++++---------- pubspec.yaml | 2 +- 4 files changed, 56 insertions(+), 62 deletions(-) diff --git a/lib/src/config/ui_config.dart b/lib/src/config/ui_config.dart index 69ba19f8..02f9027c 100644 --- a/lib/src/config/ui_config.dart +++ b/lib/src/config/ui_config.dart @@ -194,6 +194,8 @@ class UIConfig { static Color downloadPageCardSelectedColor(BuildContext context) => Theme.of(context).colorScheme.primaryContainer; + static const double downloadPageCardBorderRadius = 12; + static BoxShadow downloadPageCardShadow(BuildContext context) => BoxShadow( color: Theme.of(context).colorScheme.onBackground.withOpacity(0.1), blurRadius: 2, diff --git a/lib/src/pages/download/list/archive/archive_list_download_page.dart b/lib/src/pages/download/list/archive/archive_list_download_page.dart index 3e837934..a01923eb 100644 --- a/lib/src/pages/download/list/archive/archive_list_download_page.dart +++ b/lib/src/pages/download/list/archive/archive_list_download_page.dart @@ -207,10 +207,16 @@ class ArchiveListDownloadPage extends StatelessWidget with Scroll2TopPageMixin, } Widget _buildCard(BuildContext context, ArchiveDownloadedData archive) { - return SizedBox( - height: UIConfig.downloadPageCardHeight, - child: ClipRRect( - borderRadius: BorderRadius.circular(15), + return GetBuilder( + id: '${logic.itemCardId}::${archive.gid}', + builder: (_) => Container( + decoration: state.selectedGids.contains(archive.gid) + ? BoxDecoration( + color: UIConfig.downloadPageCardSelectedColor(context), + borderRadius: BorderRadius.circular(UIConfig.downloadPageCardBorderRadius), + ) + : null, + height: UIConfig.downloadPageCardHeight, child: Row( children: [ _buildCover(archive), @@ -229,6 +235,7 @@ class ArchiveListDownloadPage extends StatelessWidget with Scroll2TopPageMixin, galleryImage: GalleryImage(url: archive.coverUrl), containerWidth: UIConfig.downloadPageCoverWidth, containerHeight: UIConfig.downloadPageCoverHeight, + borderRadius: BorderRadius.circular(UIConfig.downloadPageCardBorderRadius), fit: BoxFit.fitWidth, maxBytes: 2 * 1024 * 1024, ), @@ -240,34 +247,23 @@ class ArchiveListDownloadPage extends StatelessWidget with Scroll2TopPageMixin, child: GestureDetector( behavior: HitTestBehavior.opaque, onTap: () => logic.handleTapItem(archive), - child: GetBuilder( - id: '${logic.itemCardId}::${archive.gid}', - builder: (_) { - return Container( - padding: const EdgeInsets.only(left: 6, right: 10, bottom: 6, top: 6), - decoration: state.selectedGids.contains(archive.gid) - ? BoxDecoration( - color: UIConfig.downloadPageCardSelectedColor(context), - borderRadius: const BorderRadius.only(topRight: Radius.circular(15), bottomRight: Radius.circular(15)), - ) - : null, - child: Stack( + child: Container( + padding: const EdgeInsets.only(left: 6, right: 10, bottom: 6, top: 6), + child: Stack( + children: [ + Column( + mainAxisSize: MainAxisSize.min, children: [ - Column( - mainAxisSize: MainAxisSize.min, - children: [ - _buildInfoHeader(context, archive), - const Expanded(child: SizedBox()), - _buildInfoCenter(context, archive), - const Expanded(child: SizedBox()), - _buildInfoFooter(context, archive), - ], - ), - if (state.selectedGids.contains(archive.gid)) const Positioned(child: Center(child: Icon(Icons.check_circle))), + _buildInfoHeader(context, archive), + const Expanded(child: SizedBox()), + _buildInfoCenter(context, archive), + const Expanded(child: SizedBox()), + _buildInfoFooter(context, archive), ], ), - ); - }, + if (state.selectedGids.contains(archive.gid)) const Positioned(child: Center(child: Icon(Icons.check_circle))), + ], + ), ), ), ); diff --git a/lib/src/pages/download/list/gallery/gallery_list_download_page.dart b/lib/src/pages/download/list/gallery/gallery_list_download_page.dart index 6b0b0178..a4f44fbd 100644 --- a/lib/src/pages/download/list/gallery/gallery_list_download_page.dart +++ b/lib/src/pages/download/list/gallery/gallery_list_download_page.dart @@ -222,10 +222,16 @@ class GalleryListDownloadPage extends StatelessWidget with Scroll2TopPageMixin, } Widget _buildCard(BuildContext context, GalleryDownloadedData gallery) { - return SizedBox( - height: UIConfig.downloadPageCardHeight, - child: ClipRRect( - borderRadius: BorderRadius.circular(15), + return GetBuilder( + id: '${logic.itemCardId}::${gallery.gid}', + builder: (_) => Container( + height: UIConfig.downloadPageCardHeight, + decoration: state.selectedGids.contains(gallery.gid) + ? BoxDecoration( + color: UIConfig.downloadPageCardSelectedColor(context), + borderRadius: BorderRadius.circular(UIConfig.downloadPageCardBorderRadius), + ) + : null, child: Row( children: [ _buildCover(context, gallery), @@ -258,6 +264,7 @@ class GalleryListDownloadPage extends StatelessWidget with Scroll2TopPageMixin, galleryImage: image!, containerWidth: UIConfig.downloadPageCoverWidth, containerHeight: UIConfig.downloadPageCoverHeight, + borderRadius: BorderRadius.circular(UIConfig.downloadPageCardBorderRadius), fit: BoxFit.fitWidth, maxBytes: 2 * 1024 * 1024, ); @@ -271,34 +278,23 @@ class GalleryListDownloadPage extends StatelessWidget with Scroll2TopPageMixin, child: GestureDetector( behavior: HitTestBehavior.opaque, onTap: () => logic.handleTapItem(gallery), - child: GetBuilder( - id: '${logic.itemCardId}::${gallery.gid}', - builder: (_) { - return Stack( - children: [ - Container( - padding: const EdgeInsets.only(left: 6, right: 10, bottom: 6, top: 6), - decoration: state.selectedGids.contains(gallery.gid) - ? BoxDecoration( - color: UIConfig.downloadPageCardSelectedColor(context), - borderRadius: const BorderRadius.only(topRight: Radius.circular(15), bottomRight: Radius.circular(15)), - ) - : null, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - _buildInfoHeader(context, gallery), - const Expanded(child: SizedBox()), - _buildInfoCenter(context, gallery), - const Expanded(child: SizedBox()), - _buildInfoFooter(context, gallery), - ], - ), - ), - if (state.selectedGids.contains(gallery.gid)) const Positioned(child: Center(child: Icon(Icons.check_circle))), - ], - ); - }, + child: Stack( + children: [ + Container( + padding: const EdgeInsets.only(left: 6, right: 10, bottom: 6, top: 6), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + _buildInfoHeader(context, gallery), + const Expanded(child: SizedBox()), + _buildInfoCenter(context, gallery), + const Expanded(child: SizedBox()), + _buildInfoFooter(context, gallery), + ], + ), + ), + if (state.selectedGids.contains(gallery.gid)) const Positioned(child: Center(child: Icon(Icons.check_circle))), + ], ), ), ); diff --git a/pubspec.yaml b/pubspec.yaml index 6411d7c0..c06a15da 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: jhentai description: A flutter app for E-Hentai/EXHentai publish_to: 'none' -version: 7.1.3+128 +version: 7.2.0+129 environment: sdk: '>=3.0.0 <4.0.0'