Ayah.fromJson constructor

Ayah.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Ayah.fromJson(Map<String, dynamic> json) {
  return Ayah(
    id: json['id'] as int,
    surahNumber: json['surah'] as int? ?? 0,
    text: json['text'] as String,
    page: json['page'] as int,
    juz: json['juz'] as int,
    tafsir:
        json['tafsir'] as String?, // Might be null if loaded from quran only
    isSajda: json['is_sajda'] as bool? ?? false,
  );
}