From bc0914e1464f75700667f1661641853191d2e3df Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Sat, 14 Dec 2024 12:25:42 +0800 Subject: [PATCH] opt: color Signed-off-by: bggRGjQaUbCoE --- lib/pages/dynamics/detail/view.dart | 11 ++++++-- lib/pages/follow/widgets/follow_item.dart | 2 +- .../content/video/member_video.dart | 14 ++++++++-- .../member/new/widget/user_info_card.dart | 10 +++---- lib/pages/member/widgets/profile.dart | 4 +-- lib/pages/search/view.dart | 26 ++++++++++++++++--- .../search_panel/widgets/article_panel.dart | 8 +++--- .../search_panel/widgets/user_panel.dart | 8 +++--- .../search_panel/widgets/video_panel.dart | 24 ++++++++++------- lib/pages/video/detail/introduction/view.dart | 12 +++++---- .../introduction/widgets/fav_panel.dart | 5 ++-- .../introduction/widgets/group_panel.dart | 3 +-- lib/pages/video/detail/reply/view.dart | 12 +++++++-- .../detail/reply/widgets/reply_item.dart | 12 ++++----- .../detail/reply/widgets/reply_item_grpc.dart | 12 ++++----- lib/pages/video/detail/reply_reply/view.dart | 11 ++++++-- lib/pages/video/detail/view.dart | 2 +- 17 files changed, 115 insertions(+), 61 deletions(-) diff --git a/lib/pages/dynamics/detail/view.dart b/lib/pages/dynamics/detail/view.dart index b33f7808..db248646 100644 --- a/lib/pages/dynamics/detail/view.dart +++ b/lib/pages/dynamics/detail/view.dart @@ -393,10 +393,17 @@ class _DynamicDetailPageState extends State height: 35, child: TextButton.icon( onPressed: () => _dynamicDetailController.queryBySort(), - icon: const Icon(Icons.sort, size: 16), + icon: Icon( + Icons.sort, + size: 16, + color: Theme.of(context).colorScheme.secondary, + ), label: Obx(() => Text( _dynamicDetailController.sortTypeLabel.value, - style: const TextStyle(fontSize: 13), + style: TextStyle( + fontSize: 13, + color: Theme.of(context).colorScheme.secondary, + ), )), ), ) diff --git a/lib/pages/follow/widgets/follow_item.dart b/lib/pages/follow/widgets/follow_item.dart index 28b106ec..8ba6cab1 100644 --- a/lib/pages/follow/widgets/follow_item.dart +++ b/lib/pages/follow/widgets/follow_item.dart @@ -57,7 +57,7 @@ class FollowItem extends StatelessWidget { padding: const EdgeInsets.fromLTRB(15, 0, 15, 0), foregroundColor: Theme.of(context).colorScheme.outline, backgroundColor: - Theme.of(context).colorScheme.onInverseSurface, // 设置按钮背景色 + Theme.of(context).colorScheme.onInverseSurface, ), child: const Text( '已关注', diff --git a/lib/pages/member/new/content/member_contribute/content/video/member_video.dart b/lib/pages/member/new/content/member_contribute/content/video/member_video.dart index 61722d40..d2c8e6f5 100644 --- a/lib/pages/member/new/content/member_contribute/content/video/member_video.dart +++ b/lib/pages/member/new/content/member_contribute/content/video/member_video.dart @@ -86,7 +86,12 @@ class _MemberVideoState extends State height: 35, child: TextButton.icon( onPressed: _controller.queryBySort, - icon: const Icon(Icons.sort, size: 16), + icon: Icon( + Icons.sort, + size: 16, + color: + Theme.of(context).colorScheme.secondary, + ), label: Obx( () => Text( widget.type == ContributeType.video @@ -96,7 +101,12 @@ class _MemberVideoState extends State : _controller.sort.value == 'desc' ? '默认' : '倒序', - style: const TextStyle(fontSize: 13), + style: TextStyle( + fontSize: 13, + color: Theme.of(context) + .colorScheme + .secondary, + ), ), ), ), diff --git a/lib/pages/member/new/widget/user_info_card.dart b/lib/pages/member/new/widget/user_info_card.dart index 6318b21b..d3e6d8d8 100644 --- a/lib/pages/member/new/widget/user_info_card.dart +++ b/lib/pages/member/new/widget/user_info_card.dart @@ -131,11 +131,11 @@ class UserInfoCard extends StatelessWidget { imageUrl: card.vip!.label!.image!, height: 20, ), - if (card.nameplate?.image?.isNotEmpty == true) - CachedNetworkImage( - imageUrl: card.nameplate!.image!, - height: 20, - ), + // if (card.nameplate?.image?.isNotEmpty == true) + // CachedNetworkImage( + // imageUrl: card.nameplate!.image!, + // height: 20, + // ), // GestureDetector( // onTap: () { // Utils.copyText(card.mid.toString()); diff --git a/lib/pages/member/widgets/profile.dart b/lib/pages/member/widgets/profile.dart index f40da039..c162063c 100644 --- a/lib/pages/member/widgets/profile.dart +++ b/lib/pages/member/widgets/profile.dart @@ -199,9 +199,7 @@ class ProfilePanel extends StatelessWidget { ? Theme.of(context) .colorScheme .onInverseSurface - : Theme.of(context) - .colorScheme - .primary, // 设置按钮背景色 + : Theme.of(context).colorScheme.primary, ), child: Obx(() => Text(ctr.attributeText.value)), ), diff --git a/lib/pages/search/view.dart b/lib/pages/search/view.dart index 268401e4..39d83b2e 100644 --- a/lib/pages/search/view.dart +++ b/lib/pages/search/view.dart @@ -130,8 +130,17 @@ class _SearchPageState extends State with RouteAware { ), ), onPressed: _searchController.queryHotSearchList, - icon: const Icon(Icons.refresh_outlined, size: 18), - label: const Text('刷新'), + icon: Icon( + Icons.refresh_outlined, + size: 18, + color: Theme.of(context).colorScheme.secondary, + ), + label: Text( + '刷新', + style: TextStyle( + color: Theme.of(context).colorScheme.secondary, + ), + ), ), ), ], @@ -183,8 +192,17 @@ class _SearchPageState extends State with RouteAware { ), ), onPressed: _searchController.onClearHistory, - icon: const Icon(Icons.clear_all_outlined, size: 18), - label: const Text('清空'), + icon: Icon( + Icons.clear_all_outlined, + size: 18, + color: Theme.of(context).colorScheme.secondary, + ), + label: Text( + '清空', + style: TextStyle( + color: Theme.of(context).colorScheme.secondary, + ), + ), ), ) ], diff --git a/lib/pages/search_panel/widgets/article_panel.dart b/lib/pages/search_panel/widgets/article_panel.dart index fd49d97b..244dbb24 100644 --- a/lib/pages/search_panel/widgets/article_panel.dart +++ b/lib/pages/search_panel/widgets/article_panel.dart @@ -293,10 +293,10 @@ class ArticlePanelController extends GetxController { }, onLongSelect: (_) {}, bgColor: item['value'] == currentOrderFilterval.value - ? Theme.of(context).colorScheme.primaryContainer + ? Theme.of(context).colorScheme.secondaryContainer : null, textColor: item['value'] == currentOrderFilterval.value - ? Theme.of(context).colorScheme.onPrimaryContainer + ? Theme.of(context).colorScheme.onSecondaryContainer : null, ), ) @@ -327,10 +327,10 @@ class ArticlePanelController extends GetxController { }, onLongSelect: (_) {}, bgColor: item['value'] == currentZoneFilterval.value - ? Theme.of(context).colorScheme.primaryContainer + ? Theme.of(context).colorScheme.secondaryContainer : null, textColor: item['value'] == currentZoneFilterval.value - ? Theme.of(context).colorScheme.onPrimaryContainer + ? Theme.of(context).colorScheme.onSecondaryContainer : null, ), ) diff --git a/lib/pages/search_panel/widgets/user_panel.dart b/lib/pages/search_panel/widgets/user_panel.dart index 4618a4e6..4badab7a 100644 --- a/lib/pages/search_panel/widgets/user_panel.dart +++ b/lib/pages/search_panel/widgets/user_panel.dart @@ -227,10 +227,10 @@ class UserPanelController extends GetxController { }, onLongSelect: (_) {}, bgColor: item['value'] == currentOrderFilterval.value - ? Theme.of(context).colorScheme.primaryContainer + ? Theme.of(context).colorScheme.secondaryContainer : null, textColor: item['value'] == currentOrderFilterval.value - ? Theme.of(context).colorScheme.onPrimaryContainer + ? Theme.of(context).colorScheme.onSecondaryContainer : null, ), ) @@ -261,11 +261,11 @@ class UserPanelController extends GetxController { }, onLongSelect: (_) {}, bgColor: item['value'] == currentUserTypeFilterval.value - ? Theme.of(context).colorScheme.primaryContainer + ? Theme.of(context).colorScheme.secondaryContainer : null, textColor: item['value'] == currentUserTypeFilterval.value - ? Theme.of(context).colorScheme.onPrimaryContainer + ? Theme.of(context).colorScheme.onSecondaryContainer : null, ), ) diff --git a/lib/pages/search_panel/widgets/video_panel.dart b/lib/pages/search_panel/widgets/video_panel.dart index 1a433778..803bb463 100644 --- a/lib/pages/search_panel/widgets/video_panel.dart +++ b/lib/pages/search_panel/widgets/video_panel.dart @@ -311,11 +311,11 @@ class VideoPanelController extends GetxController { onLongSelect: (_) {}, bgColor: currentPubTimeFilterval == -1 && (isFirst ? customPubBegin : customPubEnd) - ? Theme.of(context).colorScheme.primaryContainer - : null, + ? Theme.of(context).colorScheme.secondaryContainer + : Theme.of(context).colorScheme.outline.withOpacity(0.1), textColor: currentPubTimeFilterval == -1 && (isFirst ? customPubBegin : customPubEnd) - ? Theme.of(context).colorScheme.onPrimaryContainer + ? Theme.of(context).colorScheme.onSecondaryContainer : Theme.of(context).colorScheme.outline.withOpacity(0.8), ); } @@ -386,12 +386,14 @@ class VideoPanelController extends GetxController { }, onLongSelect: (_) {}, bgColor: item['value'] == currentPubTimeFilterval - ? Theme.of(context).colorScheme.primaryContainer + ? Theme.of(context) + .colorScheme + .secondaryContainer : null, textColor: item['value'] == currentPubTimeFilterval ? Theme.of(context) .colorScheme - .onPrimaryContainer + .onSecondaryContainer : null, ), ) @@ -435,12 +437,14 @@ class VideoPanelController extends GetxController { }, onLongSelect: (_) {}, bgColor: item['value'] == currentTimeFilterval - ? Theme.of(context).colorScheme.primaryContainer + ? Theme.of(context) + .colorScheme + .secondaryContainer : null, textColor: item['value'] == currentTimeFilterval ? Theme.of(context) .colorScheme - .onPrimaryContainer + .onSecondaryContainer : null, ), ) @@ -471,12 +475,14 @@ class VideoPanelController extends GetxController { }, onLongSelect: (_) {}, bgColor: item['value'] == currentZoneFilterval - ? Theme.of(context).colorScheme.primaryContainer + ? Theme.of(context) + .colorScheme + .secondaryContainer : null, textColor: item['value'] == currentZoneFilterval ? Theme.of(context) .colorScheme - .onPrimaryContainer + .onSecondaryContainer : null, ), ) diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index d37ba9fb..f7c6a730 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -305,8 +305,9 @@ class _VideoInfoState extends State with TickerProviderStateMixin { maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: 12, - color: t.colorScheme.primary), + fontSize: 12, + // color: t.colorScheme.primary, + ), // semanticsLabel: "UP主:${owner.name}", ), const SizedBox(height: 0), @@ -667,11 +668,12 @@ class _VideoInfoState extends State with TickerProviderStateMixin { onPressed: () => videoIntroController.actionRelationMod(context), style: TextButton.styleFrom( visualDensity: const VisualDensity(horizontal: -2, vertical: -3), - foregroundColor: - attr != 0 ? t.colorScheme.outline : t.colorScheme.onPrimary, + foregroundColor: attr != 0 + ? t.colorScheme.outline + : t.colorScheme.onSecondaryContainer, backgroundColor: attr != 0 ? t.colorScheme.onInverseSurface - : t.colorScheme.primary, // 设置按钮背景色 + : t.colorScheme.secondaryContainer, ), child: Text( attr == 128 diff --git a/lib/pages/video/detail/introduction/widgets/fav_panel.dart b/lib/pages/video/detail/introduction/widgets/fav_panel.dart index 316e670a..6e8224e6 100644 --- a/lib/pages/video/detail/introduction/widgets/fav_panel.dart +++ b/lib/pages/video/detail/introduction/widgets/fav_panel.dart @@ -179,9 +179,8 @@ class _FavPanelState extends State { vertical: -2, ), foregroundColor: Theme.of(context).colorScheme.outline, - backgroundColor: Theme.of(context) - .colorScheme - .onInverseSurface, // 设置按钮背景色 + backgroundColor: + Theme.of(context).colorScheme.onInverseSurface, ), child: const Text('取消'), ), diff --git a/lib/pages/video/detail/introduction/widgets/group_panel.dart b/lib/pages/video/detail/introduction/widgets/group_panel.dart index 04c264fd..55a213f7 100644 --- a/lib/pages/video/detail/introduction/widgets/group_panel.dart +++ b/lib/pages/video/detail/introduction/widgets/group_panel.dart @@ -178,8 +178,7 @@ class _GroupPanelState extends State { style: TextButton.styleFrom( padding: const EdgeInsets.only(left: 30, right: 30), foregroundColor: Theme.of(context).colorScheme.onPrimary, - backgroundColor: - Theme.of(context).colorScheme.primary, // 设置按钮背景色 + backgroundColor: Theme.of(context).colorScheme.primary, ), child: Text(showDefaultBtn ? '保存至默认分组' : '保存'), ), diff --git a/lib/pages/video/detail/reply/view.dart b/lib/pages/video/detail/reply/view.dart index d59376db..e9b25f4f 100644 --- a/lib/pages/video/detail/reply/view.dart +++ b/lib/pages/video/detail/reply/view.dart @@ -150,11 +150,19 @@ class _VideoReplyPanelState extends State child: TextButton.icon( onPressed: () => _videoReplyController.queryBySort(), - icon: const Icon(Icons.sort, size: 16), + icon: Icon( + Icons.sort, + size: 16, + color: Theme.of(context).colorScheme.secondary, + ), label: Obx( () => Text( _videoReplyController.sortTypeLabel.value, - style: const TextStyle(fontSize: 13), + style: TextStyle( + fontSize: 13, + color: + Theme.of(context).colorScheme.secondary, + ), ), ), ), diff --git a/lib/pages/video/detail/reply/widgets/reply_item.dart b/lib/pages/video/detail/reply/widgets/reply_item.dart index 752586ef..8a861f39 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item.dart @@ -373,7 +373,7 @@ class ReplyItem extends StatelessWidget { child: Text( 'UP主觉得很赞', style: TextStyle( - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context).colorScheme.secondary, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, fontWeight: FontWeight.normal, ), @@ -387,7 +387,7 @@ class ReplyItem extends StatelessWidget { Text( '热评', style: TextStyle( - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context).colorScheme.secondary, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize), ), const Spacer(), @@ -459,7 +459,7 @@ class ReplyItem extends StatelessWidget { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.85), + .withOpacity(0.8), height: 1.6), overflow: TextOverflow.ellipsis, maxLines: 2, @@ -471,7 +471,7 @@ class ReplyItem extends StatelessWidget { color: Theme.of(context) .colorScheme .primary - .withOpacity(0.85), + .withOpacity(0.8), ), recognizer: TapGestureRecognizer() ..onTap = () { @@ -541,14 +541,14 @@ class ReplyItem extends StatelessWidget { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.85))), + .withOpacity(0.8))), TextSpan( text: replyControl!.entryText!, style: TextStyle( color: Theme.of(context) .colorScheme .primary - .withOpacity(0.85), + .withOpacity(0.8), ), ) ], diff --git a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart index d7cc8bb7..a3372e53 100644 --- a/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart +++ b/lib/pages/video/detail/reply/widgets/reply_item_grpc.dart @@ -371,7 +371,7 @@ class ReplyItemGrpc extends StatelessWidget { child: Text( 'UP主觉得很赞', style: TextStyle( - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context).colorScheme.secondary, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize, fontWeight: FontWeight.normal, ), @@ -387,7 +387,7 @@ class ReplyItemGrpc extends StatelessWidget { Text( '热评', style: TextStyle( - color: Theme.of(context).colorScheme.primary, + color: Theme.of(context).colorScheme.secondary, fontSize: Theme.of(context).textTheme.labelMedium!.fontSize), ), if (replyLevel == '2' && @@ -475,7 +475,7 @@ class ReplyItemGrpc extends StatelessWidget { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.85), + .withOpacity(0.8), height: 1.6), overflow: TextOverflow.ellipsis, maxLines: 2, @@ -487,7 +487,7 @@ class ReplyItemGrpc extends StatelessWidget { color: Theme.of(context) .colorScheme .primary - .withOpacity(0.85), + .withOpacity(0.8), ), recognizer: TapGestureRecognizer() ..onTap = () { @@ -560,14 +560,14 @@ class ReplyItemGrpc extends StatelessWidget { color: Theme.of(context) .colorScheme .onSurface - .withOpacity(0.85))), + .withOpacity(0.8))), TextSpan( text: replyItem.replyControl.subReplyEntryText, style: TextStyle( color: Theme.of(context) .colorScheme .primary - .withOpacity(0.85), + .withOpacity(0.8), ), ) ], diff --git a/lib/pages/video/detail/reply_reply/view.dart b/lib/pages/video/detail/reply_reply/view.dart index 87ab781d..a23927f3 100644 --- a/lib/pages/video/detail/reply_reply/view.dart +++ b/lib/pages/video/detail/reply_reply/view.dart @@ -248,14 +248,21 @@ class _VideoReplyReplyPanelState extends State { height: 35, child: TextButton.icon( onPressed: () => _videoReplyReplyController.queryBySort(), - icon: const Icon(Icons.sort, size: 16), + icon: Icon( + Icons.sort, + size: 16, + color: Theme.of(context).colorScheme.secondary, + ), label: Obx( () => Text( _videoReplyReplyController.mode.value == Mode.MAIN_LIST_HOT ? '按热度' : '按时间', - style: const TextStyle(fontSize: 13), + style: TextStyle( + fontSize: 13, + color: Theme.of(context).colorScheme.secondary, + ), ), ), ), diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 83032028..d97dce82 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -1201,7 +1201,7 @@ class _VideoDetailPageState extends State // ignore: deprecated_member_use color: videoDetailController .plPlayerController.isOpenDanmu.value - ? Theme.of(context).colorScheme.primary + ? Theme.of(context).colorScheme.secondary : Theme.of(context).colorScheme.outline, ), ),