loadQuranData static method
Load Quran data from assets
Implementation
static Future<QuranData> loadQuranData() async {
if (_cachedData != null) {
return _cachedData!;
}
try {
// Load JSON data from assets
final String jsonString =
await rootBundle.loadString('assets/quran.json');
final Map<String, dynamic> jsonData = json.decode(jsonString);
_cachedData = QuranData.fromJson(jsonData);
return _cachedData!;
} catch (e) {
throw Exception('Failed to load Quran data: $e');
}
}