Added Getters for Models

main
Kai Mannweiler 2023-03-03 12:47:54 +01:00
parent afd5e37ecf
commit 1566f5c92a
4 changed files with 7 additions and 0 deletions

View File

@ -8,6 +8,7 @@ class Mood implements DatabaseRecord {
Mood(this._moodValue, this._comment, this._date);
DateTime get date => _date;
int get moodValue => _moodValue;
@override
factory Mood.fromDatabase(Map<String, dynamic> map) {

View File

@ -7,6 +7,9 @@ class Relapse implements DatabaseRecord {
Relapse(this._category, this._comment, this._date);
String get category => _category;
DateTime get date => _date;
@override
factory Relapse.fromDatabase(Map<String, dynamic> map) {
DateTime date = DateTime.parse(map['date']);

View File

@ -12,6 +12,7 @@ class Sleep implements DatabaseRecord {
this._wokeUpAt);
DateTime get date => _date;
int get sleepQualitiyValue => _sleepQualityValue;
@override
factory Sleep.fromDatabase(Map<String, dynamic> map) {

View File

@ -8,6 +8,8 @@ class Workout implements DatabaseRecord {
Workout(this._motivationBefore, this._motivationAfter, this._workoutDate);
DateTime get date => _workoutDate;
int get motivationBefore => _motivationBefore;
int get motivationAfter => _motivationAfter;
@override
factory Workout.fromDatabase(Map<String, dynamic> map) {