fetchFurigana method

List<RubyTextData>? fetchFurigana(
  1. {required DictionaryHeading heading}
)

Fetch furigana for a certain term and reading. If already obtained, use the cache.

Implementation

List<RubyTextData>? fetchFurigana({required DictionaryHeading heading}) {
  if (segmentsCache.containsKey(heading)) {
    return segmentsCache[heading];
  }
  List<RubyTextData> furigana =
      LanguageUtils.distributeFurigana(heading: heading);

  segmentsCache[heading] = furigana;

  return furigana;
}