Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-30 23:51:48 +08:00
parent 678db34c81
commit acb6bc569e
6 changed files with 106 additions and 72 deletions

View File

@@ -22,7 +22,7 @@ Widget iconButton({
color: iconColor ?? Theme.of(context).colorScheme.onSecondaryContainer, color: iconColor ?? Theme.of(context).colorScheme.onSecondaryContainer,
), ),
style: IconButton.styleFrom( style: IconButton.styleFrom(
padding: EdgeInsets.all(0), padding: EdgeInsets.zero,
backgroundColor: backgroundColor:
bgColor ?? Theme.of(context).colorScheme.secondaryContainer, bgColor ?? Theme.of(context).colorScheme.secondaryContainer,
), ),

View File

@@ -1,6 +1,7 @@
import 'dart:math'; import 'dart:math';
import 'package:PiliPlus/common/constants.dart'; import 'package:PiliPlus/common/constants.dart';
import 'package:PiliPlus/common/widgets/icon_button.dart';
import 'package:PiliPlus/common/widgets/network_img_layer.dart'; import 'package:PiliPlus/common/widgets/network_img_layer.dart';
import 'package:PiliPlus/utils/download.dart'; import 'package:PiliPlus/utils/download.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@@ -72,18 +73,19 @@ void imageSaveDialog({
), ),
), ),
const SizedBox(width: 4), const SizedBox(width: 4),
IconButton( iconButton(
context: context,
tooltip: '分享', tooltip: '分享',
onPressed: () { onPressed: () {
DownloadUtils.onShareImg(cover ?? ''); DownloadUtils.onShareImg(cover ?? '');
}, },
icon: Icon( iconSize: 20,
Icons.share, icon: Icons.share,
size: 20, bgColor: Colors.transparent,
color: Theme.of(context).colorScheme.onSurfaceVariant, iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
),
), ),
IconButton( iconButton(
context: context,
tooltip: '保存封面图', tooltip: '保存封面图',
onPressed: () async { onPressed: () async {
bool saveStatus = await DownloadUtils.downloadImg( bool saveStatus = await DownloadUtils.downloadImg(
@@ -95,11 +97,10 @@ void imageSaveDialog({
SmartDialog.dismiss(); SmartDialog.dismiss();
} }
}, },
icon: Icon( iconSize: 20,
Icons.download, icon: Icons.download,
size: 20, bgColor: Colors.transparent,
color: Theme.of(context).colorScheme.onSurfaceVariant, iconColor: Theme.of(context).colorScheme.onSurfaceVariant,
),
), ),
], ],
), ),

View File

@@ -15,6 +15,7 @@ class RetryInterceptor extends Interceptor {
case DioExceptionType.connectionError: case DioExceptionType.connectionError:
case DioExceptionType.connectionTimeout: case DioExceptionType.connectionTimeout:
case DioExceptionType.sendTimeout: case DioExceptionType.sendTimeout:
case DioExceptionType.unknown:
if ((err.requestOptions.extra['_rt'] ??= 0) < _count) { if ((err.requestOptions.extra['_rt'] ??= 0) < _count) {
Future.delayed( Future.delayed(
Duration( Duration(

View File

@@ -112,45 +112,52 @@ class _BangumiPageState extends State<BangumiPage>
size: 20, size: 20,
), ),
), ),
Obx(() => _bangumiController.isLogin.value Obx(
? Padding( () => _bangumiController.isLogin.value
padding: const EdgeInsets.symmetric( ? Padding(
horizontal: 10), padding: const EdgeInsets.symmetric(
child: GestureDetector( horizontal: 10),
onTap: () { child: GestureDetector(
Get.toNamed( behavior: HitTestBehavior.opaque,
'/fav', onTap: () {
arguments: widget.tabType == Get.toNamed(
TabType.bangumi '/fav',
? 1 arguments: widget.tabType ==
: 2, TabType.bangumi
); ? 1
}, : 2,
child: Row( );
mainAxisSize: MainAxisSize.min, },
children: [ child: Padding(
Text( padding: const EdgeInsets.symmetric(
'查看全部', vertical: 8),
strutStyle: StrutStyle( child: Row(
leading: 0, height: 1), mainAxisSize: MainAxisSize.min,
style: TextStyle( children: [
height: 1, Text(
color: Theme.of(context) '查看全部',
.colorScheme strutStyle: StrutStyle(
.secondary, leading: 0, height: 1),
), style: TextStyle(
height: 1,
color: Theme.of(context)
.colorScheme
.secondary,
),
),
Icon(
Icons.chevron_right,
color: Theme.of(context)
.colorScheme
.secondary,
),
],
), ),
Icon( ),
Icons.chevron_right,
color: Theme.of(context)
.colorScheme
.secondary,
),
],
), ),
), )
) : const SizedBox.shrink(),
: const SizedBox.shrink()), ),
], ],
), ),
), ),
@@ -183,6 +190,7 @@ class _BangumiPageState extends State<BangumiPage>
style: Theme.of(context).textTheme.titleMedium, style: Theme.of(context).textTheme.titleMedium,
), ),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if (widget.tabType == TabType.bangumi) { if (widget.tabType == TabType.bangumi) {
Get.to(PgcIndexPage()); Get.to(PgcIndexPage());
@@ -214,22 +222,25 @@ class _BangumiPageState extends State<BangumiPage>
); );
} }
}, },
child: Row( child: Padding(
mainAxisSize: MainAxisSize.min, padding: const EdgeInsets.symmetric(vertical: 2),
children: [ child: Row(
Text( mainAxisSize: MainAxisSize.min,
'查看更多', children: [
strutStyle: StrutStyle(leading: 0, height: 1), Text(
style: TextStyle( '查看更多',
height: 1, strutStyle: StrutStyle(leading: 0, height: 1),
style: TextStyle(
height: 1,
color: Theme.of(context).colorScheme.secondary,
),
),
Icon(
Icons.chevron_right,
color: Theme.of(context).colorScheme.secondary, color: Theme.of(context).colorScheme.secondary,
), ),
), ],
Icon( ),
Icons.chevron_right,
color: Theme.of(context).colorScheme.secondary,
),
],
), ),
), ),
], ],

View File

@@ -88,11 +88,19 @@ class _FavNoteChildPageState extends State<FavNoteChildPage>
), ),
), ),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
_favNoteController.handleSelect( _favNoteController.handleSelect(
!_favNoteController.allSelected.value); !_favNoteController.allSelected.value);
}, },
child: const Text('全选'), child: Padding(
padding: const EdgeInsets.only(
top: 14,
bottom: 14,
right: 12,
),
child: const Text('全选'),
),
), ),
const Spacer(), const Spacer(),
FilledButton.tonal( FilledButton.tonal(

View File

@@ -95,11 +95,19 @@ class _FavPgcChildPageState extends State<FavPgcChildPage>
), ),
), ),
GestureDetector( GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
_favPgcController.handleSelect( _favPgcController.handleSelect(
!_favPgcController.allSelected.value); !_favPgcController.allSelected.value);
}, },
child: const Text('全选'), child: Padding(
padding: const EdgeInsets.only(
top: 14,
bottom: 14,
right: 12,
),
child: const Text('全选'),
),
), ),
const Spacer(), const Spacer(),
...[ ...[
@@ -113,6 +121,7 @@ class _FavPgcChildPageState extends State<FavPgcChildPage>
(Map item) => Padding( (Map item) => Padding(
padding: const EdgeInsets.only(left: 25), padding: const EdgeInsets.only(left: 25),
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
if (_favPgcController.checkedCount.value != if (_favPgcController.checkedCount.value !=
0) { 0) {
@@ -120,12 +129,16 @@ class _FavPgcChildPageState extends State<FavPgcChildPage>
.onUpdate(item['followStatus']); .onUpdate(item['followStatus']);
} }
}, },
child: Text( child: Padding(
'标记为${item['title']}', padding: const EdgeInsets.symmetric(
style: TextStyle( vertical: 14, horizontal: 5),
color: Theme.of(context) child: Text(
.colorScheme '标记为${item['title']}',
.onSurfaceVariant, style: TextStyle(
color: Theme.of(context)
.colorScheme
.onSurfaceVariant,
),
), ),
), ),
), ),