switchFontType method

Future<void> switchFontType({
  1. required int fontIndex,
})

تبديل نوع الخط وتحميله إذا لم يكن محملاً من قبل

Switch font type and download it if not already downloaded

Implementation

Future<void> switchFontType({required int fontIndex}) async {
  // إعادة التحقق من حالة التحميل من التخزين
  // Re-check download status from storage
  final storageValue =
      GetStorage().read<bool>(_StorageConstants().isDownloadedCodeV4Fonts);
  state.isFontDownloaded.value = storageValue ?? false;

  await selectRecitation(QuranRecitation.fromIndex(fontIndex));
}