fix body height of layout builder

This commit is contained in:
2024-10-08 14:47:19 +02:00
parent bd39f49402
commit 709a161cd0

View File

@@ -66,24 +66,44 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
Widget getBody(double width, double height) { Widget getBody(double width, double height) {
if (widget.pullDownToRefresh == true) { if (widget.pullDownToRefresh == true) {
return RefreshIndicator( return LayoutBuilder(builder: (context, BoxConstraints constraints) {
onRefresh: widget.onPullDown, double newheight = constraints.maxHeight;
child: SingleChildScrollView( print(newheight);
child: SafeArea( return RefreshIndicator(
child: SizedBox( onRefresh: widget.onPullDown,
width: width, child: ListView.builder(
height: height, itemCount: 1,
child: Column( itemBuilder: (BuildContext context, int index) {
mainAxisAlignment: MainAxisAlignment.start, return SafeArea(
children: [ child: SizedBox(
getLayoutHeader(), width: width,
Expanded(child: widget.body), height: newheight,
], child: Column(
), mainAxisAlignment: MainAxisAlignment.start,
), children: [
getLayoutHeader(),
Expanded(child: widget.body),
],
),
),
);
},
// child: SafeArea(
// child: SizedBox(
// width: width,
// height: height,
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// getLayoutHeader(),
// Expanded(child: widget.body),
// ],
// ),
// ),
// ),
), ),
), );
); });
} else { } else {
return SafeArea( return SafeArea(
child: SizedBox( child: SizedBox(