getNoReadingFrequencies method

List<DictionaryFrequency> getNoReadingFrequencies(
  1. {required DictionaryHeading heading}
)

Adds a DictionarySearchResult to dictionary history.

Implementation

List<DictionaryFrequency> getNoReadingFrequencies(
    {required DictionaryHeading heading}) {
  if (heading.reading.isEmpty) {
    return [];
  }

  return _database.dictionaryHeadings
          .getSync(DictionaryHeading.hash(term: heading.term, reading: ''))
          ?.frequencies
          .where((frequency) =>
              !frequency.dictionary.value!.isHidden(targetLanguage))
          .toList() ??
      [];
}