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 1/3] 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(); } } From adc59a6f42db0d6873bedd6290a3ace0ca34285f Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Mon, 20 Feb 2023 23:30:45 +0100 Subject: [PATCH 2/3] use const --- lib/pages/sleep_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pages/sleep_page.dart b/lib/pages/sleep_page.dart index ebb89d4..e736f44 100644 --- a/lib/pages/sleep_page.dart +++ b/lib/pages/sleep_page.dart @@ -6,6 +6,6 @@ class SleepPage extends StatelessWidget { @override Widget build(BuildContext context) { - return Center(child: SleepForm()); + return const Center(child: SleepForm()); } } From 5083722d9f7e8f596485e9611b3f064ee9e45a3f Mon Sep 17 00:00:00 2001 From: Crondung <1922635@stud.hs-mannheim.de> Date: Mon, 20 Feb 2023 23:33:51 +0100 Subject: [PATCH 3/3] use const --- lib/widgets/timepicker.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/timepicker.dart b/lib/widgets/timepicker.dart index 98f6a54..6f422ef 100644 --- a/lib/widgets/timepicker.dart +++ b/lib/widgets/timepicker.dart @@ -21,7 +21,7 @@ class TimePickerState extends State { child: Column(children: [ Text( widget.descriptionText, - style: TextStyle(fontSize: 12), + style: const TextStyle(fontSize: 12), ), Row(mainAxisAlignment: MainAxisAlignment.center, children: [ Text(