QuranTextService class

Service for fetching Quran text, translations, and transliterations from the free alquran.cloud API.

Data is fetched on-demand per-surah and cached locally as JSON files.

Properties

diskUsage Future<int>
Get total disk usage of cached editions in bytes.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearAll() Future<void>
Clear all cached data.
deleteEdition(String editionId) Future<void>
Delete a downloaded edition.
downloadEdition(String editionId) Future<void>
Download a complete edition (all 114 surahs) from alquran.cloud.
getAyahText(String editionId, int surah, int ayah) Future<String?>
Get translation text for a specific ayah.
getPageTranslations(String editionId, List<({int ayah, int surah})> ayahRefs) Future<Map<String, String>>
Get translations for all ayahs on a specific page. Returns map of "surah:ayah" → text.
getSurahText(String editionId, int surah) Future<Map<int, String>?>
Get all ayah translations for a specific surah.
init() Future<void>
Initialize the service. Call once at startup.
isDownloaded(String editionId) bool
Whether a full edition is downloaded locally.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
progressFor(String editionId) ValueNotifier<double?>
Download progress notifier for an edition.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

availableLanguages List<String>
Get all unique language codes available.
no setter
instance QuranTextService
final

Static Methods

editionsForLanguage(String lang) List<QuranEdition>
Get editions filtered by language.