I am designing a login and sign up screen. I want to use the entire screen height if the content is less than screen height and use Expandable()
inside the column else I want it to be scrollable. to avoid bottom over flow.
I have tried this two methods Flutter - Enable scroll only if content height is greater than screen height and flutter - correct way to create a box that starts at minHeight, grows to maxHeight
this is is what i have tried,
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: AppBar(
toolbarHeight: 56,
),
body: Form(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(mainAxisAlignment: MainAxisAlignment.spaceBetween,
// mainAxisSize: MainAxisSize.min,
children: [
Column(
children: [
vSpace10,
const H1('Enter your Mobile Number'),
vSpace25,
InputField(
hintText: "MobileNumber",
),
],
),
// const Expanded(child: SizedBox()),
Column(
children: [
MyButton(title: "Sign In", onTap: () {}),
vSpace25,
// const SizedBox(height: 200,)
],
),
]),
// child: Container(
// constraints: BoxConstraints(
// minHeight: MediaQuery.of(context).size.height - 120 ,
// ),
// child: SingleChildScrollView(
// child: Container(
// constraints: BoxConstraints(
// minHeight: MediaQuery.of(context).size.height - 120.0 ,
// ),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// // mainAxisSize: MainAxisSize.min,
// children: [
// Column(
// children: [
// vSpace10,
// const H1('Enter your Mobile Number'),
// vSpace25,
// InputField(
// hintText: "MobileNumber",
// ),
// ],
// ),
// // const Expanded(child: SizedBox()),
// MyButton(title: "Sign In", onTap: () {
// },),
// ]),
// ),
// ),
// ),
),
),
);
}
I have tried many things but it is not working as expected;