add safearea when pull down is enabled

This commit is contained in:
2025-01-14 12:56:08 +02:00
parent 7a8f18f219
commit 0b663ef4cc

View File

@@ -67,46 +67,48 @@ 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) { return SafeArea(
double newheight = constraints.maxHeight; child: LayoutBuilder(builder: (context, BoxConstraints constraints) {
//print(newheight); double newheight = constraints.maxHeight;
return RefreshIndicator( //print(newheight);
onRefresh: widget.onPullDown, return RefreshIndicator(
child: ListView.builder( onRefresh: widget.onPullDown,
itemCount: 1, child: ListView.builder(
itemBuilder: (BuildContext context, int index) { itemCount: 1,
return SafeArea( itemBuilder: (BuildContext context, int index) {
child: SizedBox( return SafeArea(
width: width, child: SizedBox(
height: newheight, width: width,
child: Column( height: newheight,
mainAxisAlignment: MainAxisAlignment.start, child: Column(
children: [ mainAxisAlignment: MainAxisAlignment.start,
const SizedBox(height: 5), children: [
getLayoutHeader(), const SizedBox(height: 5),
const SizedBox(height: 5), getLayoutHeader(),
Expanded(child: widget.body), const SizedBox(height: 5),
], Expanded(child: widget.body),
],
),
), ),
), );
); },
}, // child: SafeArea(
// child: SafeArea( // child: SizedBox(
// child: SizedBox( // width: width,
// width: width, // height: height,
// height: height, // child: Column(
// child: Column( // mainAxisAlignment: MainAxisAlignment.start,
// mainAxisAlignment: MainAxisAlignment.start, // children: [
// children: [ // getLayoutHeader(),
// getLayoutHeader(), // Expanded(child: widget.body),
// Expanded(child: widget.body), // ],
// ], // ),
// ), // ),
// ), // ),
// ), ),
), );
); }),
}); );
} else { } else {
return SafeArea( return SafeArea(
child: SizedBox( child: SizedBox(