opt search page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-09 17:39:18 +08:00
parent 720f3e10e8
commit 27c9c266c1

View File

@@ -81,10 +81,10 @@ class _SearchPageState extends State<SearchPage> {
children: [ children: [
if (_searchController.searchSuggestion) _searchSuggest(), if (_searchController.searchSuggestion) _searchSuggest(),
if (isPortrait) ...[ if (isPortrait) ...[
if (_searchController.enableTrending) hotSearch(theme), if (_searchController.enableTrending) hotSearch(theme, isPortrait),
_history(theme, isPortrait), _history(theme, isPortrait),
if (_searchController.enableSearchRcmd) if (_searchController.enableSearchRcmd)
hotSearch(theme, isTrending: false), hotSearch(theme, isPortrait, isTrending: false),
] else ] else
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -94,9 +94,10 @@ class _SearchPageState extends State<SearchPage> {
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
if (_searchController.enableTrending) hotSearch(theme), if (_searchController.enableTrending)
hotSearch(theme, isPortrait),
if (_searchController.enableSearchRcmd) if (_searchController.enableSearchRcmd)
hotSearch(theme, isTrending: false), hotSearch(theme, isPortrait, isTrending: false),
], ],
), ),
), ),
@@ -157,7 +158,7 @@ class _SearchPageState extends State<SearchPage> {
); );
} }
Widget hotSearch(ThemeData theme, {bool isTrending = true}) { Widget hotSearch(ThemeData theme, bool isPortrait, {bool isTrending = true}) {
final text = Text( final text = Text(
isTrending ? '大家都在搜' : '搜索发现', isTrending ? '大家都在搜' : '搜索发现',
strutStyle: const StrutStyle(leading: 0, height: 1), strutStyle: const StrutStyle(leading: 0, height: 1),
@@ -174,7 +175,14 @@ class _SearchPageState extends State<SearchPage> {
color: outline, color: outline,
); );
return Padding( return Padding(
padding: EdgeInsets.fromLTRB(10, isTrending ? 25 : 4, 4, 25), padding: EdgeInsets.fromLTRB(
10,
!isTrending && (isPortrait || _searchController.enableTrending)
? 4
: 25,
4,
25,
),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [