pipSearchResultProvider top-level property
final
A global Provider for listening to search results in PIP mode.
Implementation
final pipSearchResultProvider =
FutureProvider<DictionarySearchResult?>((ref) async {
AppModel appModel = ref.watch(appProvider);
int currentPosition = ref.watch(pipSearchPositionProvider);
String searchTerm = ref.watch(pipSearchTermProvider);
DictionarySearchResult result = await appModel.searchDictionary(
searchTerm: searchTerm.substring(currentPosition),
searchWithWildcards: false,
);
appModel.addToDictionaryHistory(result: result);
return result;
});