mod: icon

This commit is contained in:
bggRGjQaUbCoE
2024-08-28 17:17:57 +08:00
parent 00d13dd594
commit c7ebe92f4e
16 changed files with 53 additions and 61 deletions

View File

@@ -36,7 +36,7 @@ class SSearchController extends GetxController {
searchKeyWord.value = hintText;
}
}
historyCacheList = List<String>.from(historyWord.get('cacheList')??[]);
historyCacheList = List<String>.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<String> arr = historyCacheList.where((e) => e != searchKeyWord.value).toList();
List<String> arr =
historyCacheList.where((e) => e != searchKeyWord.value).toList();
arr.insert(0, searchKeyWord.value);
historyCacheList = arr;

View File

@@ -55,7 +55,7 @@ class _SearchPageState extends State<SearchPage> 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<SearchPage> 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(),
),
),