diff options
| author | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
|---|---|---|
| committer | mirror <mirror@localhost> | 2026-11-22 08:41:00 +0900 |
| commit | 449d8b74bd6d9dae98a07254cdfad677b920e7b0 (patch) | |
| tree | c131c3528c4d517f56e19b854a7453fedb097d40 /lib/model/settings/modules/search.dart | |
| download | aves-src-master.tar.gz aves-src-master.zip | |
Diffstat (limited to 'lib/model/settings/modules/search.dart')
| -rw-r--r-- | lib/model/settings/modules/search.dart | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/model/settings/modules/search.dart b/lib/model/settings/modules/search.dart new file mode 100644 index 0000000..3a5ff94 --- /dev/null +++ b/lib/model/settings/modules/search.dart @@ -0,0 +1,13 @@ +import 'package:aves/model/filters/filters.dart'; +import 'package:aves/model/settings/defaults.dart'; +import 'package:aves_model/aves_model.dart'; + +mixin SearchSettings on SettingsAccess { + bool get saveSearchHistory => getBool(SettingKeys.saveSearchHistoryKey) ?? SettingsDefaults.saveSearchHistory; + + set saveSearchHistory(bool newValue) => set(SettingKeys.saveSearchHistoryKey, newValue); + + List<CollectionFilter> get searchHistory => (getStringList(SettingKeys.searchHistoryKey) ?? []).map(CollectionFilter.fromJson).nonNulls.toList(); + + set searchHistory(List<CollectionFilter> newValue) => set(SettingKeys.searchHistoryKey, newValue.map((filter) => filter.toJson()).toList()); +} |
