代码优化2

This commit is contained in:
DelLevin-Home
2026-06-27 19:20:03 +08:00
parent bcff4f6c01
commit a1fe0a23ef
31 changed files with 285 additions and 162 deletions

View File

@@ -159,7 +159,7 @@ class UserPrefs {
List<String> get searchHistory => prefs.getStringList('searchHistory') ?? [];
Future<bool> setSearchHistory(List<String> value) => prefs.setStringList('searchHistory', value);
/// 添加搜索记录(最多 20 条)
/// 添加搜索记录(最多 50 条)
Future<void> addSearchHistory(String keyword) async {
final list = searchHistory;
list.remove(keyword);