From 0080e396052afd35e3810a4ff02c13b21e8b1b62 Mon Sep 17 00:00:00 2001 From: Marco Date: Mon, 10 Jun 2024 03:31:06 +0200 Subject: [PATCH] Change some paddings --- lib/perdate_widget.dart | 22 ++++++--- lib/row_with_spacers_widget.dart | 79 ++++++++++++++++---------------- 2 files changed, 55 insertions(+), 46 deletions(-) diff --git a/lib/perdate_widget.dart b/lib/perdate_widget.dart index 2079974..2c9bfd7 100644 --- a/lib/perdate_widget.dart +++ b/lib/perdate_widget.dart @@ -26,15 +26,23 @@ class PerDateWidget extends StatelessWidget { itemCount: state.foodEntries.length + 2, itemBuilder: (BuildContext itemBuilderContext, int index) { if (index == state.foodEntries.length) { - return SumWidget(limit: state.kcalLimit); + return Padding( + padding: const EdgeInsets.symmetric(vertical: 15), + child: SumWidget(limit: state.kcalLimit), + ); } if (index == state.foodEntries.length + 1) { - return EnterFoodWidget( - onAdd: (context, entry) { - context - .read() - .add(FoodEntryEvent(entry: entry, date: date)); - }, + return Column( + children: [ + EnterFoodWidget( + onAdd: (context, entry) { + context + .read() + .add(FoodEntryEvent(entry: entry, date: date)); + }, + ), + const SizedBox(height: 75), + ], ); } diff --git a/lib/row_with_spacers_widget.dart b/lib/row_with_spacers_widget.dart index 966457d..8005911 100644 --- a/lib/row_with_spacers_widget.dart +++ b/lib/row_with_spacers_widget.dart @@ -18,45 +18,46 @@ class RowWidgetWithSpacers extends StatefulWidget { class _RowWidgetWithSpacersState extends State { @override Widget build(BuildContext context) { - return Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Expanded( - flex: 5, - child: Padding( - padding: - const EdgeInsets.symmetric(vertical: 2.0, horizontal: 2.0), - child: widget.widget1 ?? Container(), - )), - Expanded( - flex: 5, - child: Padding( - padding: - const EdgeInsets.symmetric(vertical: 2.0, horizontal: 2.0), - child: widget.widget2 ?? Container(), - )), - Expanded( - flex: 5, - child: Padding( - padding: - const EdgeInsets.symmetric(vertical: 2.0, horizontal: 2.0), - child: widget.widget3 ?? Container(), - )), - Expanded( - flex: 5, - child: Padding( - padding: - const EdgeInsets.symmetric(vertical: 2.0, horizontal: 2.0), - child: widget.widget4 ?? Container(), - )), - Expanded( - flex: 5, - child: Padding( - padding: - const EdgeInsets.symmetric(vertical: 2.0, horizontal: 2.0), - child: widget.widget5 ?? Container(), - )), - ], + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + flex: 5, + child: Padding( + padding: const EdgeInsets.only( + left: 8.0, + right: 2.0, + ), + child: widget.widget1 ?? Container(), + )), + Expanded( + flex: 5, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 2.0), + child: widget.widget2 ?? Container(), + )), + Expanded( + flex: 5, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 2.0), + child: widget.widget3 ?? Container(), + )), + Expanded( + flex: 5, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 2.0), + child: widget.widget4 ?? Container(), + )), + Expanded( + flex: 2, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 2.0), + child: widget.widget5 ?? Container(), + )), + ], + ), ); } }