Initial commit
This commit is contained in:
34
flutter_app/lib/models/bible_verse.dart
Normal file
34
flutter_app/lib/models/bible_verse.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
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,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user