class AyaModel { int totalItemsCount; int statusCode; String message; List data; AyaModel({this.totalItemsCount, this.statusCode, this.message, this.data}); AyaModel.fromJson(Map json) { totalItemsCount = json['totalItemsCount']; statusCode = json['statusCode']; message = json['message']; if (json['data'] != null) { data = new List(); json['data'].forEach((v) { data.add(new AyaModelData.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); data['totalItemsCount'] = this.totalItemsCount; data['statusCode'] = this.statusCode; data['message'] = this.message; if (this.data != null) { data['data'] = this.data.map((v) => v.toJson()).toList(); } return data; } } class AyaModelData { int surahID; String surahNameAR; String surahNameEN; int numberOfAyahs; String englishNameTranslation; int revelationID; String revelationType; int ayahID; int numberInSurah; int page; int quarterID; int juzID; int manzil; bool sajda; String ayahText; Null eighthsID; AyaModelData( {this.surahID, this.surahNameAR, this.surahNameEN, this.numberOfAyahs, this.englishNameTranslation, this.revelationID, this.revelationType, this.ayahID, this.numberInSurah, this.page, this.quarterID, this.juzID, this.manzil, this.sajda, this.ayahText, this.eighthsID}); AyaModelData.fromJson(Map json) { surahID = json['surahID']; surahNameAR = json['surahNameAR']; surahNameEN = json['surahNameEN']; numberOfAyahs = json['numberOfAyahs']; englishNameTranslation = json['englishNameTranslation']; revelationID = json['revelation_ID']; revelationType = json['revelationType']; ayahID = json['ayahID']; numberInSurah = json['numberInSurah']; page = json['page']; quarterID = json['quarter_ID']; juzID = json['juz_ID']; manzil = json['manzil']; sajda = json['sajda']; ayahText = json['ayah_Text']; eighthsID = json['eighths_ID']; } Map toJson() { final Map data = new Map(); data['surahID'] = this.surahID; data['surahNameAR'] = this.surahNameAR; data['surahNameEN'] = this.surahNameEN; data['numberOfAyahs'] = this.numberOfAyahs; data['englishNameTranslation'] = this.englishNameTranslation; data['revelation_ID'] = this.revelationID; data['revelationType'] = this.revelationType; data['ayahID'] = this.ayahID; data['numberInSurah'] = this.numberInSurah; data['page'] = this.page; data['quarter_ID'] = this.quarterID; data['juz_ID'] = this.juzID; data['manzil'] = this.manzil; data['sajda'] = this.sajda; data['ayah_Text'] = this.ayahText; data['eighths_ID'] = this.eighthsID; return data; } }