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] 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), ),