Skip to content

Commit

Permalink
v7.2.0+129
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangtian616 committed May 30, 2023
1 parent 27bb307 commit b9b197b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 62 deletions.
2 changes: 2 additions & 0 deletions lib/src/config/ui_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
54 changes: 25 additions & 29 deletions lib/src/pages/download/list/archive/archive_list_download_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<ArchiveListDownloadPageLogic>(
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),
Expand All @@ -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,
),
Expand All @@ -240,34 +247,23 @@ class ArchiveListDownloadPage extends StatelessWidget with Scroll2TopPageMixin,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => logic.handleTapItem(archive),
child: GetBuilder<ArchiveListDownloadPageLogic>(
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))),
],
),
),
),
);
Expand Down
60 changes: 28 additions & 32 deletions lib/src/pages/download/list/gallery/gallery_list_download_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<GalleryListDownloadPageLogic>(
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),
Expand Down Expand Up @@ -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,
);
Expand All @@ -271,34 +278,23 @@ class GalleryListDownloadPage extends StatelessWidget with Scroll2TopPageMixin,
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () => logic.handleTapItem(gallery),
child: GetBuilder<GalleryListDownloadPageLogic>(
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))),
],
),
),
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit b9b197b

Please sign in to comment.