diff --git a/lib/common/widgets/icon_button.dart b/lib/common/widgets/icon_button.dart index 961492d6..92046344 100644 --- a/lib/common/widgets/icon_button.dart +++ b/lib/common/widgets/icon_button.dart @@ -22,7 +22,7 @@ Widget iconButton({ color: iconColor ?? Theme.of(context).colorScheme.onSecondaryContainer, ), style: IconButton.styleFrom( - padding: EdgeInsets.all(0), + padding: EdgeInsets.zero, backgroundColor: bgColor ?? Theme.of(context).colorScheme.secondaryContainer, ), diff --git a/lib/common/widgets/image_save.dart b/lib/common/widgets/image_save.dart index 8c0484a9..75c0836d 100644 --- a/lib/common/widgets/image_save.dart +++ b/lib/common/widgets/image_save.dart @@ -1,6 +1,7 @@ import 'dart:math'; 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/utils/download.dart'; import 'package:flutter/material.dart'; @@ -72,18 +73,19 @@ void imageSaveDialog({ ), ), const SizedBox(width: 4), - IconButton( + iconButton( + context: context, tooltip: '分享', onPressed: () { DownloadUtils.onShareImg(cover ?? ''); }, - icon: Icon( - Icons.share, - size: 20, - color: Theme.of(context).colorScheme.onSurfaceVariant, - ), + iconSize: 20, + icon: Icons.share, + bgColor: Colors.transparent, + iconColor: Theme.of(context).colorScheme.onSurfaceVariant, ), - IconButton( + iconButton( + context: context, tooltip: '保存封面图', onPressed: () async { bool saveStatus = await DownloadUtils.downloadImg( @@ -95,11 +97,10 @@ void imageSaveDialog({ SmartDialog.dismiss(); } }, - icon: Icon( - Icons.download, - size: 20, - color: Theme.of(context).colorScheme.onSurfaceVariant, - ), + iconSize: 20, + icon: Icons.download, + bgColor: Colors.transparent, + iconColor: Theme.of(context).colorScheme.onSurfaceVariant, ), ], ), diff --git a/lib/http/retry_interceptor.dart b/lib/http/retry_interceptor.dart index b04e7814..6e4647a7 100644 --- a/lib/http/retry_interceptor.dart +++ b/lib/http/retry_interceptor.dart @@ -15,6 +15,7 @@ class RetryInterceptor extends Interceptor { case DioExceptionType.connectionError: case DioExceptionType.connectionTimeout: case DioExceptionType.sendTimeout: + case DioExceptionType.unknown: if ((err.requestOptions.extra['_rt'] ??= 0) < _count) { Future.delayed( Duration( diff --git a/lib/pages/bangumi/view.dart b/lib/pages/bangumi/view.dart index 8fd21ed8..5013a1bc 100644 --- a/lib/pages/bangumi/view.dart +++ b/lib/pages/bangumi/view.dart @@ -112,45 +112,52 @@ class _BangumiPageState extends State size: 20, ), ), - Obx(() => _bangumiController.isLogin.value - ? Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10), - child: GestureDetector( - onTap: () { - Get.toNamed( - '/fav', - arguments: widget.tabType == - TabType.bangumi - ? 1 - : 2, - ); - }, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - '查看全部', - strutStyle: StrutStyle( - leading: 0, height: 1), - style: TextStyle( - height: 1, - color: Theme.of(context) - .colorScheme - .secondary, - ), + Obx( + () => _bangumiController.isLogin.value + ? Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10), + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + Get.toNamed( + '/fav', + arguments: widget.tabType == + TabType.bangumi + ? 1 + : 2, + ); + }, + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 8), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + '查看全部', + 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, + ), + ], ), - Icon( - Icons.chevron_right, - color: Theme.of(context) - .colorScheme - .secondary, - ), - ], + ), ), - ), - ) - : const SizedBox.shrink()), + ) + : const SizedBox.shrink(), + ), ], ), ), @@ -183,6 +190,7 @@ class _BangumiPageState extends State style: Theme.of(context).textTheme.titleMedium, ), GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { if (widget.tabType == TabType.bangumi) { Get.to(PgcIndexPage()); @@ -214,22 +222,25 @@ class _BangumiPageState extends State ); } }, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - '查看更多', - strutStyle: StrutStyle(leading: 0, height: 1), - style: TextStyle( - height: 1, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 2), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + '查看更多', + 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, ), - ), - Icon( - Icons.chevron_right, - color: Theme.of(context).colorScheme.secondary, - ), - ], + ], + ), ), ), ], diff --git a/lib/pages/fav/note/child_view.dart b/lib/pages/fav/note/child_view.dart index d2891e8f..b12e0500 100644 --- a/lib/pages/fav/note/child_view.dart +++ b/lib/pages/fav/note/child_view.dart @@ -88,11 +88,19 @@ class _FavNoteChildPageState extends State ), ), GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { _favNoteController.handleSelect( !_favNoteController.allSelected.value); }, - child: const Text('全选'), + child: Padding( + padding: const EdgeInsets.only( + top: 14, + bottom: 14, + right: 12, + ), + child: const Text('全选'), + ), ), const Spacer(), FilledButton.tonal( diff --git a/lib/pages/fav/pgc/child_view.dart b/lib/pages/fav/pgc/child_view.dart index 8f1d1b61..04c42b67 100644 --- a/lib/pages/fav/pgc/child_view.dart +++ b/lib/pages/fav/pgc/child_view.dart @@ -95,11 +95,19 @@ class _FavPgcChildPageState extends State ), ), GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { _favPgcController.handleSelect( !_favPgcController.allSelected.value); }, - child: const Text('全选'), + child: Padding( + padding: const EdgeInsets.only( + top: 14, + bottom: 14, + right: 12, + ), + child: const Text('全选'), + ), ), const Spacer(), ...[ @@ -113,6 +121,7 @@ class _FavPgcChildPageState extends State (Map item) => Padding( padding: const EdgeInsets.only(left: 25), child: GestureDetector( + behavior: HitTestBehavior.opaque, onTap: () { if (_favPgcController.checkedCount.value != 0) { @@ -120,12 +129,16 @@ class _FavPgcChildPageState extends State .onUpdate(item['followStatus']); } }, - child: Text( - '标记为${item['title']}', - style: TextStyle( - color: Theme.of(context) - .colorScheme - .onSurfaceVariant, + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 14, horizontal: 5), + child: Text( + '标记为${item['title']}', + style: TextStyle( + color: Theme.of(context) + .colorScheme + .onSurfaceVariant, + ), ), ), ),