Rohan Patil
Rohan Patil

Reputation: 131

Whenever i try to comeback from another screen my keyboard pop up everytime in flutter

application preview

while cooming back from any screen to homescreen my keyboard pop-ups automatically which makes user experience bad.

Can someone tell me how to deal with this bug.

Upvotes: 2

Views: 1208

Answers (3)

mehdi kashani
mehdi kashani

Reputation: 1

hooman's answer is true. and in bottom navigation,put code in bottomNavigation ontap.

onTap: (index) {
          setState(() {
            selectItem = index;

            FocusManager.instance.primaryFocus?.unfocus();
          });

Upvotes: 0

Genius_balu
Genius_balu

Reputation: 300

Remove what you set in textfield as autofocus true.

Upvotes: 0

Hooman
Hooman

Reputation: 803

you can run this code everywhere you change page:

FocusManager.instance.primaryFocus?.unfocus()

github issue

Upvotes: 7

Related Questions