dynamic padding if boirder is selected and scrollable view in body

This commit is contained in:
2024-09-16 14:57:25 +02:00
parent 26f1e8529f
commit 2f036bd5fc

View File

@@ -15,7 +15,15 @@ class MIHBody extends StatefulWidget {
} }
class _MIHBodyState extends State<MIHBody> { class _MIHBodyState extends State<MIHBody> {
double paddingSize = 10; //double paddingSize = 10;
double getPaddingSize() {
if (widget.borderOn) {
return 10;
} else {
return 0;
}
}
Decoration? getBoader() { Decoration? getBoader() {
if (widget.borderOn) { if (widget.borderOn) {
@@ -43,17 +51,28 @@ class _MIHBodyState extends State<MIHBody> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Expanded( Size screenSize = MediaQuery.sizeOf(context);
child: Padding( return Padding(
padding: EdgeInsets.only(
left: getPaddingSize(),
right: getPaddingSize(),
bottom: getPaddingSize(),
top: 0,
),
child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: paddingSize, left: 10,
right: paddingSize, right: 10,
bottom: paddingSize, bottom: 10,
top: getPaddingSize(),
), ),
child: Container( width: screenSize.width,
//height: height - 100, height: screenSize.height,
decoration: getBoader(), decoration: getBoader(),
child: SingleChildScrollView(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: widget.bodyItems, children: widget.bodyItems,
), ),
), ),