removeFromSearchHistory method
Remove the searchTerm
from a search history with the given historyKey
.
Implementation
Future<void> removeFromSearchHistory({
required String historyKey,
required String searchTerm,
}) async {
_database.writeTxnSync(() {
SearchHistoryItem searchHistoryItem = SearchHistoryItem(
searchTerm: searchTerm,
historyKey: historyKey,
);
_database.searchHistoryItems
.deleteByUniqueKeySync(searchHistoryItem.uniqueKey);
});
}