From ad6e890f57601792c941bf3b9a643007b0eaf390 Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Mon, 6 Mar 2023 14:53:50 +0100 Subject: [PATCH 1/7] Added getter for comments --- lib/models/mood.dart | 1 + lib/models/relapse.dart | 1 + lib/models/sleep.dart | 1 + 3 files changed, 3 insertions(+) diff --git a/lib/models/mood.dart b/lib/models/mood.dart index 9d34051..27a41d0 100644 --- a/lib/models/mood.dart +++ b/lib/models/mood.dart @@ -9,6 +9,7 @@ class Mood implements DatabaseRecord { DateTime get date => _date; int get moodValue => _moodValue; + String get comment => _comment; @override factory Mood.fromDatabase(Map map) { diff --git a/lib/models/relapse.dart b/lib/models/relapse.dart index 1507188..6bb6ea0 100644 --- a/lib/models/relapse.dart +++ b/lib/models/relapse.dart @@ -9,6 +9,7 @@ class Relapse implements DatabaseRecord { String get category => _category; DateTime get date => _date; + String get comment => _comment; @override factory Relapse.fromDatabase(Map map) { diff --git a/lib/models/sleep.dart b/lib/models/sleep.dart index 991de20..e6a0b80 100644 --- a/lib/models/sleep.dart +++ b/lib/models/sleep.dart @@ -13,6 +13,7 @@ class Sleep implements DatabaseRecord { this._wokeUpAt); DateTime get date => _date; + String get comment => _comment; int get sleepQualitiyValue => _sleepQualityValue; TimeOfDay get sleepDuration => _sleptAt.durationBetween(_wokeUpAt); From 5177d38b36eceb0f355d5e2b68f364b42dcafd63 Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Mon, 6 Mar 2023 14:55:56 +0100 Subject: [PATCH 2/7] Added Expansiontile for comments --- lib/widgets/entry_detail_title.dart | 29 ++++++++++++ lib/widgets/entry_detail_widget.dart | 62 +++++++++++++++---------- lib/widgets/history_list_widget.dart | 14 +++++- lib/widgets/view_form/mood_view.dart | 1 + lib/widgets/view_form/relapse_view.dart | 16 ++++--- lib/widgets/view_form/sleep_view.dart | 1 + 6 files changed, 90 insertions(+), 33 deletions(-) create mode 100644 lib/widgets/entry_detail_title.dart diff --git a/lib/widgets/entry_detail_title.dart b/lib/widgets/entry_detail_title.dart new file mode 100644 index 0000000..4bdff97 --- /dev/null +++ b/lib/widgets/entry_detail_title.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +class EntryDetailTitle extends StatelessWidget { + final DateTime date; + final String entryData; + + const EntryDetailTitle( + {super.key, required this.date, required this.entryData}); + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Text( + DateFormat.MMMd('de').format(date), + style: + const TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ), + Text( + entryData, + style: + const TextStyle(color: Colors.white, fontWeight: FontWeight.bold), + ) + ], + ); + } +} diff --git a/lib/widgets/entry_detail_widget.dart b/lib/widgets/entry_detail_widget.dart index 10afacc..c1585f7 100644 --- a/lib/widgets/entry_detail_widget.dart +++ b/lib/widgets/entry_detail_widget.dart @@ -1,41 +1,53 @@ import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; +import 'package:smoke_cess_app/widgets/entry_detail_title.dart'; class EntryDetail extends StatelessWidget { final DateTime date; final String entryData; - final IconData icon; + final String? entryComment; + final IconData iconData; const EntryDetail( {super.key, required this.date, required this.entryData, - required this.icon}); + required this.iconData, + required this.entryComment}); @override Widget build(BuildContext context) { + final Icon icon = Icon(iconData, color: Colors.white); + final ShapeBorder shape = RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10.0), + ); + final Color color = Theme.of(context).colorScheme.primary.withOpacity(0.8); + final Widget title = EntryDetailTitle(date: date, entryData: entryData); return Card( - child: ListTile( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10.0), - ), - leading: Icon(icon, color: Colors.white), - title: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Text( - DateFormat.MMMd('de').format(date), - style: const TextStyle( - color: Colors.white, fontWeight: FontWeight.bold), - ), - Text( - entryData, - style: const TextStyle( - color: Colors.white, fontWeight: FontWeight.bold), - ) - ], - ), - tileColor: Theme.of(context).colorScheme.primary.withOpacity(0.8), - )); + child: entryComment != null + ? ExpansionTile( + iconColor: color, + collapsedShape: shape, + shape: shape, + leading: icon, + title: title, + collapsedBackgroundColor: color, + backgroundColor: + Theme.of(context).colorScheme.secondary.withOpacity(0.8), + children: entryComment != null + ? [ + Text( + entryComment ?? '', + style: const TextStyle( + color: Colors.white, fontWeight: FontWeight.bold), + ) + ] + : [], + ) + : ListTile( + shape: shape, + leading: icon, + title: title, + tileColor: color, + )); } } diff --git a/lib/widgets/history_list_widget.dart b/lib/widgets/history_list_widget.dart index ff63e49..8a32963 100644 --- a/lib/widgets/history_list_widget.dart +++ b/lib/widgets/history_list_widget.dart @@ -6,6 +6,7 @@ class HistoryList extends StatelessWidget { final DateTime Function(T) dateSelector; final String Function(T) entryDataSelector; final IconData Function(T)? iconDataSelector; + final String Function(T)? entryCommentSelector; final IconData? icon; const HistoryList( @@ -14,7 +15,8 @@ class HistoryList extends StatelessWidget { required this.dateSelector, required this.entryDataSelector, this.iconDataSelector, - this.icon}); + this.icon, + this.entryCommentSelector}); IconData _getIcon(T entry) { if (icon != null) { @@ -25,6 +27,13 @@ class HistoryList extends StatelessWidget { return Icons.circle; } + String? _getComment(T entry) { + if (entryCommentSelector != null) { + return entryCommentSelector!(entry); + } + return null; + } + @override Widget build(BuildContext context) { return Expanded( @@ -33,7 +42,8 @@ class HistoryList extends StatelessWidget { return EntryDetail( date: dateSelector(entry), entryData: entryDataSelector(entry), - icon: _getIcon(entry)); + entryComment: _getComment(entry), + iconData: _getIcon(entry)); }).toList())); } } diff --git a/lib/widgets/view_form/mood_view.dart b/lib/widgets/view_form/mood_view.dart index 92017f0..3438f59 100644 --- a/lib/widgets/view_form/mood_view.dart +++ b/lib/widgets/view_form/mood_view.dart @@ -25,6 +25,7 @@ class MoodView extends StatelessWidget { history: tasksModel.moodHistory, dateSelector: (Mood mood) => mood.date, entryDataSelector: (Mood mood) => 'Stimmung: ${mood.moodValue}', + entryCommentSelector: (Mood mood) => 'Kommentar: ${mood.comment}', iconDataSelector: (Mood mood) => mood.moodValue >= 50 ? Icons.mood_outlined : Icons.mood_bad_outlined, diff --git a/lib/widgets/view_form/relapse_view.dart b/lib/widgets/view_form/relapse_view.dart index 92072f4..ab70de8 100644 --- a/lib/widgets/view_form/relapse_view.dart +++ b/lib/widgets/view_form/relapse_view.dart @@ -10,11 +10,15 @@ class RelapseView extends StatelessWidget { @override Widget build(BuildContext context) { TasksProvider tasksModel = context.watch(); - return HistoryList( - history: tasksModel.relapseHistory, - dateSelector: (Relapse relapse) => relapse.date, - entryDataSelector: (Relapse relapse) => 'Grund: ${relapse.category}', - icon: Icons.smoke_free_outlined, - ); + return Column(children: [ + HistoryList( + history: tasksModel.relapseHistory, + dateSelector: (Relapse relapse) => relapse.date, + entryDataSelector: (Relapse relapse) => 'Grund: ${relapse.category}', + entryCommentSelector: (Relapse relapse) => + 'Kommentar: ${relapse.comment}', + icon: Icons.smoke_free_outlined, + ) + ]); } } diff --git a/lib/widgets/view_form/sleep_view.dart b/lib/widgets/view_form/sleep_view.dart index 4e1e90d..e53837c 100644 --- a/lib/widgets/view_form/sleep_view.dart +++ b/lib/widgets/view_form/sleep_view.dart @@ -28,6 +28,7 @@ class SleepView extends StatelessWidget { dateSelector: (Sleep sleep) => sleep.date, entryDataSelector: (Sleep sleep) => '${sleep.sleepDuration.hour}:${sleep.sleepDuration.minute}', + entryCommentSelector: (Sleep sleep) => 'Kommentar: ${sleep.comment}', icon: Icons.bedtime_outlined, ) ], From 30c798c15f78ed62ece60a3091d6bcb8fd9e4939 Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Mon, 6 Mar 2023 14:58:15 +0100 Subject: [PATCH 3/7] White Icon --- lib/widgets/entry_detail_widget.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/widgets/entry_detail_widget.dart b/lib/widgets/entry_detail_widget.dart index c1585f7..c75d895 100644 --- a/lib/widgets/entry_detail_widget.dart +++ b/lib/widgets/entry_detail_widget.dart @@ -25,7 +25,8 @@ class EntryDetail extends StatelessWidget { return Card( child: entryComment != null ? ExpansionTile( - iconColor: color, + iconColor: Colors.white, + collapsedIconColor: Colors.white, collapsedShape: shape, shape: shape, leading: icon, From 56acb1e84c0d7169b2f2e3892d4041e9bb59f843 Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Mon, 6 Mar 2023 15:46:40 +0100 Subject: [PATCH 4/7] Fixed Paddings --- lib/widgets/buttons/round_button_widget.dart | 4 +- lib/widgets/buttons/submit_form_button.dart | 5 +- lib/widgets/entry_detail_title.dart | 16 ++++-- lib/widgets/entry_detail_widget.dart | 60 +++++++++++--------- lib/widgets/history_list_widget.dart | 12 ++-- lib/widgets/view_form/mood_form.dart | 3 - lib/widgets/view_form/relapse_form.dart | 3 - lib/widgets/view_form/relapse_view.dart | 2 +- lib/widgets/view_form/sleep_form.dart | 3 - lib/widgets/view_form/view_form_page.dart | 20 ++++--- 10 files changed, 66 insertions(+), 62 deletions(-) diff --git a/lib/widgets/buttons/round_button_widget.dart b/lib/widgets/buttons/round_button_widget.dart index 14efe2d..9e8d7ac 100644 --- a/lib/widgets/buttons/round_button_widget.dart +++ b/lib/widgets/buttons/round_button_widget.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; -class RoundAddButton extends StatelessWidget { +class RoundIconButton extends StatelessWidget { final VoidCallback onPressed; final IconData iconData; - const RoundAddButton( + const RoundIconButton( {super.key, required this.onPressed, required this.iconData}); @override diff --git a/lib/widgets/buttons/submit_form_button.dart b/lib/widgets/buttons/submit_form_button.dart index f9cb784..f338339 100644 --- a/lib/widgets/buttons/submit_form_button.dart +++ b/lib/widgets/buttons/submit_form_button.dart @@ -2,6 +2,7 @@ import 'package:awesome_dialog/awesome_dialog.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:smoke_cess_app/providers/page_provider.dart'; +import 'package:smoke_cess_app/widgets/buttons/round_button_widget.dart'; class SubmitFormButton extends StatelessWidget { final Future Function() submitCallback; @@ -14,7 +15,7 @@ class SubmitFormButton extends StatelessWidget { PageProvider pageProvider = context.watch(); return Padding( padding: const EdgeInsets.symmetric(vertical: 16.0), - child: ElevatedButton( + child: RoundIconButton( onPressed: () async { int success = await submitCallback(); if (context.mounted) { @@ -37,7 +38,7 @@ class SubmitFormButton extends StatelessWidget { } } }, - child: const Text('Speichern'), + iconData: Icons.check_outlined, ), ); } diff --git a/lib/widgets/entry_detail_title.dart b/lib/widgets/entry_detail_title.dart index 4bdff97..110e38f 100644 --- a/lib/widgets/entry_detail_title.dart +++ b/lib/widgets/entry_detail_title.dart @@ -11,18 +11,22 @@ class EntryDetailTitle extends StatelessWidget { @override Widget build(BuildContext context) { return Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisAlignment: MainAxisAlignment.start, children: [ Text( DateFormat.MMMd('de').format(date), style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold), ), - Text( - entryData, - style: - const TextStyle(color: Colors.white, fontWeight: FontWeight.bold), - ) + Flexible( + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 5.0), + child: Text( + entryData, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + color: Colors.white, fontWeight: FontWeight.bold), + ))) ], ); } diff --git a/lib/widgets/entry_detail_widget.dart b/lib/widgets/entry_detail_widget.dart index c75d895..0f7a70e 100644 --- a/lib/widgets/entry_detail_widget.dart +++ b/lib/widgets/entry_detail_widget.dart @@ -22,33 +22,37 @@ class EntryDetail extends StatelessWidget { ); final Color color = Theme.of(context).colorScheme.primary.withOpacity(0.8); final Widget title = EntryDetailTitle(date: date, entryData: entryData); - return Card( - child: entryComment != null - ? ExpansionTile( - iconColor: Colors.white, - collapsedIconColor: Colors.white, - collapsedShape: shape, - shape: shape, - leading: icon, - title: title, - collapsedBackgroundColor: color, - backgroundColor: - Theme.of(context).colorScheme.secondary.withOpacity(0.8), - children: entryComment != null - ? [ - Text( - entryComment ?? '', - style: const TextStyle( - color: Colors.white, fontWeight: FontWeight.bold), - ) - ] - : [], - ) - : ListTile( - shape: shape, - leading: icon, - title: title, - tileColor: color, - )); + return entryComment != null + ? ExpansionTile( + iconColor: Colors.white, + collapsedIconColor: Colors.white, + collapsedShape: shape, + shape: shape, + leading: icon, + title: title, + collapsedBackgroundColor: color, + backgroundColor: + Theme.of(context).colorScheme.secondary.withOpacity(0.8), + children: entryComment != null + ? [ + Row(mainAxisAlignment: MainAxisAlignment.start, children: [ + Padding( + padding: const EdgeInsets.fromLTRB(10, 0, 10, 10), + child: Text( + entryComment ?? '', + style: const TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold), + )) + ]) + ] + : [], + ) + : ListTile( + shape: shape, + leading: icon, + title: title, + tileColor: color, + ); } } diff --git a/lib/widgets/history_list_widget.dart b/lib/widgets/history_list_widget.dart index 8a32963..4251568 100644 --- a/lib/widgets/history_list_widget.dart +++ b/lib/widgets/history_list_widget.dart @@ -39,11 +39,13 @@ class HistoryList extends StatelessWidget { return Expanded( child: ListView( children: history.map((T entry) { - return EntryDetail( - date: dateSelector(entry), - entryData: entryDataSelector(entry), - entryComment: _getComment(entry), - iconData: _getIcon(entry)); + return Padding( + padding: const EdgeInsets.only(bottom: 5), + child: EntryDetail( + date: dateSelector(entry), + entryData: entryDataSelector(entry), + entryComment: _getComment(entry), + iconData: _getIcon(entry))); }).toList())); } } diff --git a/lib/widgets/view_form/mood_form.dart b/lib/widgets/view_form/mood_form.dart index 9985b9b..ccebb1b 100644 --- a/lib/widgets/view_form/mood_form.dart +++ b/lib/widgets/view_form/mood_form.dart @@ -26,9 +26,6 @@ class MoodForm extends StatelessWidget { title: 'Beschreibe deine Stimmung', child: MyTextFormField('Beschreibe deine Stimmung'), ), - const SizedBox( - height: 80, - ), SubmitFormButton( submitCallback: inputModel.saveMood, updateTasks: () => tasksModel.setTaskDone(Pages.mood), diff --git a/lib/widgets/view_form/relapse_form.dart b/lib/widgets/view_form/relapse_form.dart index 3d1a1ab..675e738 100644 --- a/lib/widgets/view_form/relapse_form.dart +++ b/lib/widgets/view_form/relapse_form.dart @@ -27,9 +27,6 @@ class RelapseForm extends StatelessWidget { title: 'Beschreibe deinen Rückfall', child: MyTextFormField('Beschreibe deinen Rückfall'), ), - const SizedBox( - height: 80, - ), SubmitFormButton( submitCallback: inputModel.saveRelapse, updateTasks: () => tasksModel.setTaskDone(Pages.mood), diff --git a/lib/widgets/view_form/relapse_view.dart b/lib/widgets/view_form/relapse_view.dart index ab70de8..98c011b 100644 --- a/lib/widgets/view_form/relapse_view.dart +++ b/lib/widgets/view_form/relapse_view.dart @@ -14,7 +14,7 @@ class RelapseView extends StatelessWidget { HistoryList( history: tasksModel.relapseHistory, dateSelector: (Relapse relapse) => relapse.date, - entryDataSelector: (Relapse relapse) => 'Grund: ${relapse.category}', + entryDataSelector: (Relapse relapse) => relapse.category, entryCommentSelector: (Relapse relapse) => 'Kommentar: ${relapse.comment}', icon: Icons.smoke_free_outlined, diff --git a/lib/widgets/view_form/sleep_form.dart b/lib/widgets/view_form/sleep_form.dart index bb01e37..8958eeb 100644 --- a/lib/widgets/view_form/sleep_form.dart +++ b/lib/widgets/view_form/sleep_form.dart @@ -39,9 +39,6 @@ class SleepForm extends StatelessWidget { title: 'Schlafbeschreibung', child: MyTextFormField('Beschreibe deinen Schlaf'), ), - const SizedBox( - height: 80, - ), SubmitFormButton( submitCallback: () => inputModel.saveSleep(SleepTimes.wokeUpAt, SleepTimes.sleptAt), diff --git a/lib/widgets/view_form/view_form_page.dart b/lib/widgets/view_form/view_form_page.dart index 0b348b6..2e961e2 100644 --- a/lib/widgets/view_form/view_form_page.dart +++ b/lib/widgets/view_form/view_form_page.dart @@ -21,18 +21,20 @@ class ViewFormPage extends StatelessWidget { TasksProvider tasksProvider = context.watch(); return Column(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( - child: Center( - child: pageProvider.showForm - ? ChangeNotifierProvider( - create: (context) => InputProvider(), - child: form, - ) - : view, - )), + child: Padding( + padding: const EdgeInsets.fromLTRB(10, 10, 10, 10), + child: Center( + child: pageProvider.showForm + ? ChangeNotifierProvider( + create: (context) => InputProvider(), + child: form, + ) + : view, + ))), if (!pageProvider.showForm) Container( margin: EdgeInsets.symmetric(vertical: height * 0.02), - child: RoundAddButton( + child: RoundIconButton( iconData: Icons.add_outlined, onPressed: tasksProvider.tasks[page] ?? true ? () => pageProvider.swap() From 5cce527518a57d3aa23f76774d0bef548148089d Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Mon, 6 Mar 2023 15:59:06 +0100 Subject: [PATCH 5/7] Padding to ListView --- lib/widgets/history_list_widget.dart | 17 +++++++++-------- lib/widgets/view_form/relapse_form.dart | 1 + lib/widgets/view_form/sleep_form.dart | 1 + lib/widgets/view_form/view_form_page.dart | 20 +++++++++----------- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/lib/widgets/history_list_widget.dart b/lib/widgets/history_list_widget.dart index 4251568..de434e1 100644 --- a/lib/widgets/history_list_widget.dart +++ b/lib/widgets/history_list_widget.dart @@ -38,14 +38,15 @@ class HistoryList extends StatelessWidget { Widget build(BuildContext context) { return Expanded( child: ListView( + padding: const EdgeInsets.fromLTRB(10, 10, 10, 10), children: history.map((T entry) { - return Padding( - padding: const EdgeInsets.only(bottom: 5), - child: EntryDetail( - date: dateSelector(entry), - entryData: entryDataSelector(entry), - entryComment: _getComment(entry), - iconData: _getIcon(entry))); - }).toList())); + return Padding( + padding: const EdgeInsets.only(bottom: 5), + child: EntryDetail( + date: dateSelector(entry), + entryData: entryDataSelector(entry), + entryComment: _getComment(entry), + iconData: _getIcon(entry))); + }).toList())); } } diff --git a/lib/widgets/view_form/relapse_form.dart b/lib/widgets/view_form/relapse_form.dart index 675e738..6131880 100644 --- a/lib/widgets/view_form/relapse_form.dart +++ b/lib/widgets/view_form/relapse_form.dart @@ -18,6 +18,7 @@ class RelapseForm extends StatelessWidget { var settingsModel = context.watch(); var tasksModel = context.watch(); return ListView( + padding: const EdgeInsets.fromLTRB(10, 10, 10, 10), children: [ ElevatedCard( title: 'Rückfallkategorie', diff --git a/lib/widgets/view_form/sleep_form.dart b/lib/widgets/view_form/sleep_form.dart index 8958eeb..a9998ec 100644 --- a/lib/widgets/view_form/sleep_form.dart +++ b/lib/widgets/view_form/sleep_form.dart @@ -19,6 +19,7 @@ class SleepForm extends StatelessWidget { TasksProvider tasksModel = context.watch(); return ListView( + padding: const EdgeInsets.fromLTRB(10, 10, 10, 10), children: [ const ElevatedCard( title: 'Einschlafzeit', diff --git a/lib/widgets/view_form/view_form_page.dart b/lib/widgets/view_form/view_form_page.dart index 2e961e2..c695e9c 100644 --- a/lib/widgets/view_form/view_form_page.dart +++ b/lib/widgets/view_form/view_form_page.dart @@ -21,22 +21,20 @@ class ViewFormPage extends StatelessWidget { TasksProvider tasksProvider = context.watch(); return Column(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB(10, 10, 10, 10), - child: Center( - child: pageProvider.showForm - ? ChangeNotifierProvider( - create: (context) => InputProvider(), - child: form, - ) - : view, - ))), + child: Center( + child: pageProvider.showForm + ? ChangeNotifierProvider( + create: (context) => InputProvider(), + child: form, + ) + : view, + )), if (!pageProvider.showForm) Container( margin: EdgeInsets.symmetric(vertical: height * 0.02), child: RoundIconButton( iconData: Icons.add_outlined, - onPressed: tasksProvider.tasks[page] ?? true + onPressed: true ? () => pageProvider.swap() : () => showTaskDonePopup(context, page), ), From c66ee1468c2e870af3837be24e65205ae9718f2d Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Mon, 6 Mar 2023 15:59:28 +0100 Subject: [PATCH 6/7] Padding to ListView pt2 --- lib/widgets/view_form/mood_form.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/widgets/view_form/mood_form.dart b/lib/widgets/view_form/mood_form.dart index ccebb1b..588d542 100644 --- a/lib/widgets/view_form/mood_form.dart +++ b/lib/widgets/view_form/mood_form.dart @@ -16,6 +16,7 @@ class MoodForm extends StatelessWidget { var inputModel = context.watch(); var tasksModel = context.watch(); return ListView( + padding: const EdgeInsets.fromLTRB(10, 10, 10, 10), children: [ const ElevatedCard( title: 'Stimmungsbewertung', From af628a8fabafb5291141e7cdb285fe0f1839b7cb Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Mon, 6 Mar 2023 16:07:15 +0100 Subject: [PATCH 7/7] Corrected Testing code --- lib/widgets/view_form/view_form_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/view_form/view_form_page.dart b/lib/widgets/view_form/view_form_page.dart index c695e9c..828b9af 100644 --- a/lib/widgets/view_form/view_form_page.dart +++ b/lib/widgets/view_form/view_form_page.dart @@ -34,7 +34,7 @@ class ViewFormPage extends StatelessWidget { margin: EdgeInsets.symmetric(vertical: height * 0.02), child: RoundIconButton( iconData: Icons.add_outlined, - onPressed: true + onPressed: tasksProvider.tasks[page] ?? true ? () => pageProvider.swap() : () => showTaskDonePopup(context, page), ),