fetchData method
------------FetchingMethod
------------
شرح: جلب بيانات التفسير للصفحة المطلوبة
Explanation: Fetch tafsir data for the requested page
Implementation
Future<void> fetchData(int pageNum) async {
await initializeDatabase();
try {
final List<TafsirTableData> tafsir =
await database.value!.getTafsirByPage(pageNum);
log('Fetched tafsir: [32m${tafsir.length} entries', name: 'TafsirCtrl');
if (tafsir.isNotEmpty) {
tafseerList.assignAll(tafsir);
} else {
log('No data found for this page.', name: 'TafsirCtrl');
tafseerList.clear();
}
} catch (e) {
log('Error fetching data: $e', name: 'TafsirCtrl');
}
}