This is my code:
build(BuildContext context) {
return new Scaffold(
body: new SafeArea(
child: new ListView.builder(
itemBuilder: (itemBuilder),
itemCount: (1),
padding: kMaterialListPadding,
),
)
);
}
itemBuilder(BuildContext context, int index) {
return new TextFormField(
decoration: new InputDecoration(
border: const OutlineInputBorder(),
hintText: "What's on your mind?",
helperText: "5-500 characters",
),
maxLines: 3,
);
}
When I tap on the text field, keyboard opens but lot of blank space appears on top of keyboard as you can see in the picture (border of textfield is cut).
It happens because of the ListView. If I add just the text field to the body, appearance is fine.
The reason for lot of wasted space was because there was a Scaffold inside a Scaffold. Each scaffold adding space for keyboard. Removing one solved the problem.
Scaffold has a property resizeToAvoidBottomPadding. Set this property false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With