From af5d7844e3ad25f36ae9f240c927f5d345894365 Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Mon, 20 Feb 2023 23:28:55 +0100 Subject: [PATCH] create variables when saving sleep form --- lib/widgets/sleep_form.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/widgets/sleep_form.dart b/lib/widgets/sleep_form.dart index e11dba7..cc39a4d 100644 --- a/lib/widgets/sleep_form.dart +++ b/lib/widgets/sleep_form.dart @@ -29,9 +29,12 @@ class _SleepFormState extends State { if (_sleepFormKey.currentState!.validate()) { _sleepFormKey.currentState?.save(); //call every onSave Method //TODO Businesslogik aufrufen! - print(_textInput); - print(slider.getSliderValue()); - print('Eingeschlafen um: ${sleepTimePicker.getCurrentTime}'); + String sleepComment = _textInput; + int sleepQuality = slider.getSliderValue().round(); + TimeOfDay sleepedAt = sleepTimePicker.getCurrentTime; + TimeOfDay wokeUpAt = wakeUpTimePicker.getCurrentTime; + print( + 'Eingeschlafen um: $sleepedAt, aufgewacht um: $wokeUpAt. \nKommentar zum Schlaf: $sleepComment\nSchlafqualität: $sleepQuality'); _sleepFormKey.currentState?.reset(); } }