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,13 +66,18 @@ 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 LayoutBuilder(builder: (context, BoxConstraints constraints) {
double newheight = constraints.maxHeight;
print(newheight);
return RefreshIndicator( return RefreshIndicator(
onRefresh: widget.onPullDown, onRefresh: widget.onPullDown,
child: SingleChildScrollView( child: ListView.builder(
child: SafeArea( itemCount: 1,
itemBuilder: (BuildContext context, int index) {
return SafeArea(
child: SizedBox( child: SizedBox(
width: width, width: width,
height: height, height: newheight,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
@@ -81,9 +86,24 @@ class _MIHLayoutBuilderState extends State<MIHLayoutBuilder> {
], ],
), ),
), ),
), );
},
// 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(