35 lines
750 B
Dart
35 lines
750 B
Dart
class BibleVerse {
|
|
final String id;
|
|
final String text;
|
|
final String reference;
|
|
final String? date;
|
|
final bool active;
|
|
|
|
const BibleVerse({
|
|
required this.id,
|
|
required this.text,
|
|
required this.reference,
|
|
required this.date,
|
|
required this.active,
|
|
});
|
|
|
|
factory BibleVerse.fromJson(Map<String, dynamic> json) {
|
|
return BibleVerse(
|
|
id: json["_id"] as String? ?? "",
|
|
text: json["text"] as String? ?? "",
|
|
reference: json["reference"] as String? ?? "",
|
|
date: json["date"] as String?,
|
|
active: json["active"] as bool? ?? true,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
"text": text,
|
|
"reference": reference,
|
|
"date": date,
|
|
"active": active,
|
|
};
|
|
}
|
|
}
|