You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tangheem/lib/models/aya_model.dart

109 lines
3.0 KiB
Dart

class AyaModel {
int totalItemsCount;
int statusCode;
String message;
List<AyaModelData> data;
AyaModel({this.totalItemsCount, this.statusCode, this.message, this.data});
AyaModel.fromJson(Map<String, dynamic> json) {
totalItemsCount = json['totalItemsCount'];
statusCode = json['statusCode'];
message = json['message'];
if (json['data'] != null) {
data = new List<AyaModelData>();
json['data'].forEach((v) {
data.add(new AyaModelData.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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<String, dynamic> 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<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
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;
}
}