mostFrequentSurah property

MapEntry<int, int>? get mostFrequentSurah

The surah with the most results

Implementation

MapEntry<int, int>? get mostFrequentSurah {
  if (surahDistribution.isEmpty) return null;

  return surahDistribution.entries.reduce(
    (curr, next) => curr.value > next.value ? curr : next,
  );
}