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); Mood(this._moodValue, this._comment, this._date);
DateTime get date => _date; DateTime get date => _date;
int get moodValue => _moodValue;
@override @override
factory Mood.fromDatabase(Map<String, dynamic> map) { factory Mood.fromDatabase(Map<String, dynamic> map) {

View File

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

View File

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

View File

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