opt: search page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-20 12:47:19 +08:00
parent b2edcfb6c0
commit 0870f2710e
2 changed files with 22 additions and 7 deletions

View File

@@ -411,6 +411,7 @@ class _MainAppState extends State<MainApp>
: const SizedBox.shrink(), : const SizedBox.shrink(),
), ),
IconButton( IconButton(
tooltip: '搜索',
icon: const Icon( icon: const Icon(
Icons.search_outlined, Icons.search_outlined,
semanticLabel: '搜索', semanticLabel: '搜索',

View File

@@ -74,12 +74,22 @@ class _SearchPageState extends State<SearchPage> with RouteAware {
child: Column( child: Column(
children: [ children: [
// 搜索建议 // 搜索建议
_searchSuggest(), if (_searchController.searchSuggestion) _searchSuggest(),
if (_searchController.enableHotKey) if (context.orientation == Orientation.portrait) ...[
// 热搜 if (_searchController.enableHotKey)
hotSearch(), // 热搜
// 搜索历史 hotSearch(),
_history() // 搜索历史
_history()
] else
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (_searchController.enableHotKey)
Expanded(child: hotSearch()),
Expanded(child: _history()),
],
),
], ],
), ),
), ),
@@ -174,7 +184,11 @@ class _SearchPageState extends State<SearchPage> with RouteAware {
width: double.infinity, width: double.infinity,
padding: EdgeInsets.fromLTRB( padding: EdgeInsets.fromLTRB(
10, 10,
_searchController.enableHotKey ? 0 : 6, context.orientation == Orientation.landscape
? 25
: _searchController.enableHotKey
? 0
: 6,
6, 6,
MediaQuery.of(context).padding.bottom + 50, MediaQuery.of(context).padding.bottom + 50,
), ),