When I use a textfield on the page I designed with expanded, everything gets shrink when the keyboard is opened. How can i disable this.
Asked
Active
Viewed 100 times
1
-
Set this https://api.flutter.dev/flutter/material/Scaffold/resizeToAvoidBottomInset.html on your page scaffold to false. Open keyboard will then be above all widgets without resizing, – David Sedlář Jul 19 '22 at 14:06
2 Answers
1
you can use singlechildscrollview or listview widget. They will make it scroll. and you can use MediaQuery.of(context).viewInsets.bottom for padding or margin. Get keyboard height in Flutter.

Berke Uğur
- 53
- 6
1
If you would like not to scroll the page, set Scaffold
's resizeToAvoidBottomInset
property to false
. It will avoid any effect that pops up from the keyboard. But it comes with a caveat If your TextField
is placed within the height of keyboard, whatever user types will not be able to see. Try this if it works for you.

Usama Karim
- 1,100
- 4
- 15