1

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?

Normal View

After TextField Focusing

3 Answers 3

8

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.

Sign up to request clarification or add additional context in comments.

Comments

5

To get better idea follow this reference link : https://api.flutter.dev/flutter/material/Scaffold/resizeToAvoidBottomInset.html

 return Scaffold(
      resizeToAvoidBottomInset : false,
      body: Container(),
    )

2 Comments

Strange, I answered first, still you got 2 upvotes + acceptance, bad luck Haha.
let's try next one for better luck bro.
1

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: []), );

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.