Reputation: 337
I want to get input from these TextField
. When I focus the TextField
the keyboard comes up and page scroll up. I do not need that scrolling. How can I avoid this?
Upvotes: 1
Views: 8010
Reputation: 31
textFiled when the keyboard opens then scroll your TextFiled to use SingleChildScrollView in your main Column Widget Wrap it.
SingleChildScrollView( keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag, reverse: true, child: Column( children: []), );
Upvotes: 1
Reputation: 268464
Use
Scaffold(
resizeToAvoidBottomInset: false,
...
)
From docs:
For example, if there is an onscreen keyboard displayed above the scaffold, the body can be resized to avoid overlapping the keyboard, which prevents widgets inside the body from being obscured by the keyboard.
Upvotes: 8
Reputation: 14335
To get better idea follow this reference link : https://api.flutter.dev/flutter/material/Scaffold/resizeToAvoidBottomInset.html
return Scaffold(
resizeToAvoidBottomInset : false,
body: Container(),
)
Upvotes: 5