From 1566f5c92aa7e6d4132c64f20ce5cf48f7d37b63 Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Fri, 3 Mar 2023 12:47:54 +0100 Subject: [PATCH] Added Getters for Models --- lib/models/mood.dart | 1 + lib/models/relapse.dart | 3 +++ lib/models/sleep.dart | 1 + lib/models/workout.dart | 2 ++ 4 files changed, 7 insertions(+) diff --git a/lib/models/mood.dart b/lib/models/mood.dart index 7f5e7a6..9d34051 100644 --- a/lib/models/mood.dart +++ b/lib/models/mood.dart @@ -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 map) { diff --git a/lib/models/relapse.dart b/lib/models/relapse.dart index 0271d31..1507188 100644 --- a/lib/models/relapse.dart +++ b/lib/models/relapse.dart @@ -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 map) { DateTime date = DateTime.parse(map['date']); diff --git a/lib/models/sleep.dart b/lib/models/sleep.dart index 74fd6cb..4447be4 100644 --- a/lib/models/sleep.dart +++ b/lib/models/sleep.dart @@ -12,6 +12,7 @@ class Sleep implements DatabaseRecord { this._wokeUpAt); DateTime get date => _date; + int get sleepQualitiyValue => _sleepQualityValue; @override factory Sleep.fromDatabase(Map map) { diff --git a/lib/models/workout.dart b/lib/models/workout.dart index 187b7f6..dd27105 100644 --- a/lib/models/workout.dart +++ b/lib/models/workout.dart @@ -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 map) {