From c7ebe92f4ead2b6a0344dde37561928c02747ac7 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Wed, 28 Aug 2024 17:17:57 +0800 Subject: [PATCH] mod: icon --- lib/common/widgets/video_card_h.dart | 2 +- lib/pages/about/index.dart | 1 + lib/pages/fav_search/view.dart | 6 +--- lib/pages/follow_search/view.dart | 8 ++--- lib/pages/history_search/view.dart | 6 +--- lib/pages/hot/view.dart | 4 +-- lib/pages/member/view.dart | 2 +- lib/pages/member_search/view.dart | 8 ++--- lib/pages/search/controller.dart | 8 +++-- lib/pages/search/view.dart | 8 ++--- .../search_panel/widgets/article_panel.dart | 2 +- .../search_panel/widgets/live_panel.dart | 2 +- lib/pages/video/detail/introduction/view.dart | 10 ++---- .../introduction/widgets/intro_detail.dart | 4 +-- lib/pages/video/detail/related/view.dart | 10 +++--- lib/pages/video/detail/view.dart | 33 +++++++++++++------ 16 files changed, 53 insertions(+), 61 deletions(-) diff --git a/lib/common/widgets/video_card_h.dart b/lib/common/widgets/video_card_h.dart index f9aa2409..38d6df2b 100644 --- a/lib/common/widgets/video_card_h.dart +++ b/lib/common/widgets/video_card_h.dart @@ -130,7 +130,7 @@ class VideoCardH extends StatelessWidget { if (source == 'normal') Positioned( bottom: 0, - right: 10, + right: 0, child: VideoPopupMenu( size: 29, iconSize: 17, diff --git a/lib/pages/about/index.dart b/lib/pages/about/index.dart index de94b433..ddb16036 100644 --- a/lib/pages/about/index.dart +++ b/lib/pages/about/index.dart @@ -181,6 +181,7 @@ class _AboutPageState extends State { context: context, builder: (context) { return SimpleDialog( + clipBehavior: Clip.hardEdge, title: const Text('导入/导出设置'), children: [ ListTile( diff --git a/lib/pages/fav_search/view.dart b/lib/pages/fav_search/view.dart index 445693d8..6fee0c19 100644 --- a/lib/pages/fav_search/view.dart +++ b/lib/pages/fav_search/view.dart @@ -67,11 +67,7 @@ class _FavSearchPageState extends State { border: InputBorder.none, suffixIcon: IconButton( tooltip: '清空', - icon: Icon( - Icons.clear, - size: 22, - color: Theme.of(context).colorScheme.outline, - ), + icon: const Icon(Icons.clear, size: 22), onPressed: () => _favSearchCtr.onClear(), ), ), diff --git a/lib/pages/follow_search/view.dart b/lib/pages/follow_search/view.dart index 8fbc3565..7110f36e 100644 --- a/lib/pages/follow_search/view.dart +++ b/lib/pages/follow_search/view.dart @@ -52,7 +52,7 @@ class _FollowSearchPageState extends State { IconButton( tooltip: '搜索', onPressed: reRequest, - icon: const Icon(CupertinoIcons.search, size: 22), + icon: const Icon(Icons.search, size: 22), ), const SizedBox(width: 6), ], @@ -67,11 +67,7 @@ class _FollowSearchPageState extends State { border: InputBorder.none, suffixIcon: IconButton( tooltip: '清空', - icon: Icon( - Icons.clear, - size: 22, - color: Theme.of(context).colorScheme.outline, - ), + icon: const Icon(Icons.clear, size: 22), onPressed: () => _followSearchController.onClear(), ), ), diff --git a/lib/pages/history_search/view.dart b/lib/pages/history_search/view.dart index f3ddc304..391b64ef 100644 --- a/lib/pages/history_search/view.dart +++ b/lib/pages/history_search/view.dart @@ -66,11 +66,7 @@ class _HistorySearchPageState extends State { border: InputBorder.none, suffixIcon: IconButton( tooltip: '清空', - icon: Icon( - Icons.clear, - size: 22, - color: Theme.of(context).colorScheme.outline, - ), + icon: const Icon(Icons.clear, size: 22), onPressed: () => _historySearchCtr.onClear(), ), ), diff --git a/lib/pages/hot/view.dart b/lib/pages/hot/view.dart index b02f6961..7b4d3648 100644 --- a/lib/pages/hot/view.dart +++ b/lib/pages/hot/view.dart @@ -82,8 +82,8 @@ class _HotPageState extends State with AutomaticKeepAliveClientMixin { slivers: [ SliverPadding( // 单列布局 EdgeInsets.zero - padding: const EdgeInsets.fromLTRB( - StyleString.safeSpace, StyleString.safeSpace - 5, 0, 0), + padding: const EdgeInsets.fromLTRB(StyleString.safeSpace, + StyleString.safeSpace - 5, StyleString.safeSpace, 0), sliver: FutureBuilder( future: _futureBuilderFuture, builder: (context, snapshot) { diff --git a/lib/pages/member/view.dart b/lib/pages/member/view.dart index 693bf9ef..e4cfbbde 100644 --- a/lib/pages/member/view.dart +++ b/lib/pages/member/view.dart @@ -429,7 +429,7 @@ class _MemberPageState extends State style: TextStyle( height: 1, fontSize: 12, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w500, color: Theme.of(context).colorScheme.onSecondaryContainer, ), strutStyle: const StrutStyle( diff --git a/lib/pages/member_search/view.dart b/lib/pages/member_search/view.dart index 636105de..7a06a294 100644 --- a/lib/pages/member_search/view.dart +++ b/lib/pages/member_search/view.dart @@ -56,7 +56,7 @@ class _MemberSearchPageState extends State IconButton( tooltip: '搜索', onPressed: () => _memberSearchCtr.submit(), - icon: const Icon(CupertinoIcons.search, size: 22)), + icon: const Icon(Icons.search, size: 22)), const SizedBox(width: 10) ], title: Obx( @@ -71,11 +71,7 @@ class _MemberSearchPageState extends State border: InputBorder.none, suffixIcon: IconButton( tooltip: '清空', - icon: Icon( - Icons.clear, - size: 22, - color: Theme.of(context).colorScheme.outline, - ), + icon: const Icon(Icons.clear, size: 22), onPressed: () => _memberSearchCtr.onClear(), ), ), diff --git a/lib/pages/search/controller.dart b/lib/pages/search/controller.dart index 9215c20e..cfee8bbf 100644 --- a/lib/pages/search/controller.dart +++ b/lib/pages/search/controller.dart @@ -36,7 +36,7 @@ class SSearchController extends GetxController { searchKeyWord.value = hintText; } } - historyCacheList = List.from(historyWord.get('cacheList')??[]); + historyCacheList = List.from(historyWord.get('cacheList') ?? []); historyList.value = historyCacheList; enableHotKey = setting.get(SettingBoxKey.enableHotKey, defaultValue: true); } @@ -55,6 +55,7 @@ class SSearchController extends GetxController { controller.value.clear(); searchKeyWord.value = ''; searchSuggestList.value = []; + searchFocusNode.requestFocus(); } else { Get.back(); } @@ -64,12 +65,13 @@ class SSearchController extends GetxController { void submit() { // ignore: unrelated_type_equality_checks if (searchKeyWord == '') { - if (hintText == ''){ + if (hintText == '') { return; } searchKeyWord.value = hintText; } - List arr = historyCacheList.where((e) => e != searchKeyWord.value).toList(); + List arr = + historyCacheList.where((e) => e != searchKeyWord.value).toList(); arr.insert(0, searchKeyWord.value); historyCacheList = arr; diff --git a/lib/pages/search/view.dart b/lib/pages/search/view.dart index 5df3b77d..5f14e3f1 100644 --- a/lib/pages/search/view.dart +++ b/lib/pages/search/view.dart @@ -55,7 +55,7 @@ class _SearchPageState extends State with RouteAware { IconButton( tooltip: '搜索', onPressed: () => _searchController.submit(), - icon: const Icon(CupertinoIcons.search, size: 22), + icon: const Icon(Icons.search, size: 22), ), const SizedBox(width: 10) ], @@ -71,11 +71,7 @@ class _SearchPageState extends State with RouteAware { border: InputBorder.none, suffixIcon: IconButton( tooltip: '清空', - icon: Icon( - Icons.clear, - size: 22, - color: Theme.of(context).colorScheme.outline, - ), + icon: const Icon(Icons.clear, size: 22), onPressed: () => _searchController.onClear(), ), ), diff --git a/lib/pages/search_panel/widgets/article_panel.dart b/lib/pages/search_panel/widgets/article_panel.dart index 2641d6c3..9ddc8110 100644 --- a/lib/pages/search_panel/widgets/article_panel.dart +++ b/lib/pages/search_panel/widgets/article_panel.dart @@ -74,7 +74,7 @@ Widget searchArticlePanel(BuildContext context, ctr, list) { TextSpan( text: i['text'], style: TextStyle( - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w400, letterSpacing: 0.3, color: i['type'] == 'em' ? Theme.of(context) diff --git a/lib/pages/search_panel/widgets/live_panel.dart b/lib/pages/search_panel/widgets/live_panel.dart index 41d48624..09a37d47 100644 --- a/lib/pages/search_panel/widgets/live_panel.dart +++ b/lib/pages/search_panel/widgets/live_panel.dart @@ -114,7 +114,7 @@ class LiveContent extends StatelessWidget { TextSpan( text: i['text'], style: TextStyle( - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w400, letterSpacing: 0.3, color: i['type'] == 'em' ? Theme.of(context).colorScheme.primary diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index 16a49f17..133e59ad 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -1,6 +1,3 @@ -import 'dart:ffi'; - -import 'package:flutter/cupertino.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -8,7 +5,6 @@ import 'package:get/get.dart'; import 'package:flutter/material.dart'; import 'package:hive/hive.dart'; import 'package:PiliPalaX/common/constants.dart'; -import 'package:PiliPalaX/common/widgets/http_error.dart'; import 'package:PiliPalaX/pages/mine/controller.dart'; import 'package:PiliPalaX/pages/video/detail/index.dart'; import 'package:PiliPalaX/common/widgets/network_img_layer.dart'; @@ -303,7 +299,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { // : videoItem['title'] ?? "", style: const TextStyle( fontSize: 16, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w500, ), maxLines: 2, overflow: TextOverflow.ellipsis, @@ -459,9 +455,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { () => TextButton( onPressed: () => videoIntroController.actionRelationMod(context), style: TextButton.styleFrom( - visualDensity: VisualDensity.compact, - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - padding: const EdgeInsets.only(left: 6, right: 6), + visualDensity: const VisualDensity(horizontal: -2, vertical: -3), foregroundColor: (videoIntroController.followStatus['attribute'] ?? 0) != 0 ? t.colorScheme.outline diff --git a/lib/pages/video/detail/introduction/widgets/intro_detail.dart b/lib/pages/video/detail/introduction/widgets/intro_detail.dart index c34ae693..3b7fb3bc 100644 --- a/lib/pages/video/detail/introduction/widgets/intro_detail.dart +++ b/lib/pages/video/detail/introduction/widgets/intro_detail.dart @@ -16,7 +16,7 @@ class IntroDetail extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surface, padding: const EdgeInsets.only(left: 14, right: 14), height: Utils.getSheetHeight(context), child: Column( @@ -47,7 +47,7 @@ class IntroDetail extends StatelessWidget { videoDetail!.title, style: const TextStyle( fontSize: 16, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.w500, ), ), const SizedBox(height: 6), diff --git a/lib/pages/video/detail/related/view.dart b/lib/pages/video/detail/related/view.dart index 7e2a36ca..390121b7 100644 --- a/lib/pages/video/detail/related/view.dart +++ b/lib/pages/video/detail/related/view.dart @@ -85,10 +85,12 @@ class _RelatedVideoPanelState extends State ); } else { // 请求错误 - return HttpError(errMsg: '出错了', fn: () { - _futureBuilder = _relatedController.queryRelatedVideo(); - _futureBuilder.then((value) => setState(() {})); - }); + return HttpError( + errMsg: '出错了', + fn: () { + _futureBuilder = _relatedController.queryRelatedVideo(); + _futureBuilder.then((value) => setState(() {})); + }); } } else { // 骨架屏 diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index 0def8ca9..313df39a 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:io'; import 'dart:math'; +import 'package:PiliPalaX/common/constants.dart'; import 'package:PiliPalaX/utils/extension.dart'; import 'package:auto_orientation/auto_orientation.dart'; import 'package:floating/floating.dart'; @@ -715,12 +716,18 @@ class _VideoDetailPageState extends State videoDetailController.cid.value)), ], SliverToBoxAdapter( - child: Divider( - indent: 12, - endIndent: 12, - color: Theme.of(context) - .dividerColor - .withOpacity(0.06), + child: Padding( + padding: const EdgeInsets.only( + top: StyleString.safeSpace, + ), + child: Divider( + height: 1, + indent: 12, + endIndent: 12, + color: Theme.of(context) + .dividerColor + .withOpacity(0.06), + ), ), ), RelatedVideoPanel(heroTag: heroTag), @@ -817,10 +824,16 @@ class _VideoDetailPageState extends State cid: videoDetailController.cid.value)), ], SliverToBoxAdapter( - child: Divider( - indent: 12, - endIndent: 12, - color: Theme.of(context).dividerColor.withOpacity(0.06), + child: Padding( + padding: + const EdgeInsets.only(top: StyleString.safeSpace), + child: Divider( + height: 1, + indent: 12, + endIndent: 12, + color: + Theme.of(context).dividerColor.withOpacity(0.06), + ), ), ), RelatedVideoPanel(heroTag: heroTag),