From 2f036bd5fc665defb5487b86a289932486aefaf6 Mon Sep 17 00:00:00 2001 From: yaso Date: Mon, 16 Sep 2024 14:57:25 +0200 Subject: [PATCH] dynamic padding if boirder is selected and scrollable view in body --- .../lib/components/MIH_Layout/MIH_Body.dart | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/Frontend/patient_manager/lib/components/MIH_Layout/MIH_Body.dart b/Frontend/patient_manager/lib/components/MIH_Layout/MIH_Body.dart index 77f9e1d4..80f0fe68 100644 --- a/Frontend/patient_manager/lib/components/MIH_Layout/MIH_Body.dart +++ b/Frontend/patient_manager/lib/components/MIH_Layout/MIH_Body.dart @@ -15,7 +15,15 @@ class MIHBody extends StatefulWidget { } class _MIHBodyState extends State { - double paddingSize = 10; + //double paddingSize = 10; + + double getPaddingSize() { + if (widget.borderOn) { + return 10; + } else { + return 0; + } + } Decoration? getBoader() { if (widget.borderOn) { @@ -43,17 +51,28 @@ class _MIHBodyState extends State { @override Widget build(BuildContext context) { - return Expanded( - child: Padding( + Size screenSize = MediaQuery.sizeOf(context); + return Padding( + padding: EdgeInsets.only( + left: getPaddingSize(), + right: getPaddingSize(), + bottom: getPaddingSize(), + top: 0, + ), + child: Container( padding: EdgeInsets.only( - left: paddingSize, - right: paddingSize, - bottom: paddingSize, + left: 10, + right: 10, + bottom: 10, + top: getPaddingSize(), ), - child: Container( - //height: height - 100, - decoration: getBoader(), + width: screenSize.width, + height: screenSize.height, + decoration: getBoader(), + child: SingleChildScrollView( child: Column( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, children: widget.bodyItems, ), ),