opt: fav search page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-29 10:52:08 +08:00
parent d6898bf335
commit 59e2f64164
2 changed files with 44 additions and 54 deletions

View File

@@ -29,30 +29,28 @@ class _FavSearchPageState extends State<FavSearchPage> {
appBar: AppBar(
actions: [
IconButton(
tooltip: '搜索',
onPressed: _favSearchCtr.onRefresh,
icon: const Icon(Icons.search_outlined, size: 22)),
tooltip: '搜索',
onPressed: _favSearchCtr.onRefresh,
icon: const Icon(Icons.search_outlined, size: 22),
),
const SizedBox(width: 10)
],
title: Obx(
() => TextField(
autofocus: true,
focusNode: _favSearchCtr.searchFocusNode,
controller: _favSearchCtr.controller.value,
textInputAction: TextInputAction.search,
onChanged: (value) => _favSearchCtr.onChange(value),
textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration(
hintText: _favSearchCtr.hintText,
border: InputBorder.none,
suffixIcon: IconButton(
tooltip: '清空',
icon: const Icon(Icons.clear, size: 22),
onPressed: () => _favSearchCtr.onClear(),
),
title: TextField(
autofocus: true,
focusNode: _favSearchCtr.searchFocusNode,
controller: _favSearchCtr.controller,
textInputAction: TextInputAction.search,
textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration(
hintText: '搜索',
border: InputBorder.none,
suffixIcon: IconButton(
tooltip: '清空',
icon: const Icon(Icons.clear, size: 22),
onPressed: _favSearchCtr.onClear,
),
onSubmitted: (String value) => _favSearchCtr.onRefresh(),
),
onSubmitted: (value) => _favSearchCtr.onRefresh(),
),
),
body: Obx(() => _buildBody(_favSearchCtr.loadingState.value)),