sajjad hajizadeh
sajjad hajizadeh

Reputation: 11

my keyboard opens and closed when i click on TextField in flutter

When I use the text field in each part of my program and run the program, the keyboard immediately opens and closes and doesn't give me a chance to type anything. I use version 1.17 of the Flutter SDK. Is there a problem with the widgets I use? I've used Material, Scaffold, SingleChildScrollView widgets, but my problem is still unresolved.

Upvotes: 0

Views: 3065

Answers (5)

sajjad hajizadeh
sajjad hajizadeh

Reputation: 11

i try any way for fix this problem. and i find a funny way, in my app i use a beautiful curved navigation bar package and when i deleted this and set default navigation bar in my app my problem solved

Upvotes: 0

Shahan Ahmed
Shahan Ahmed

Reputation: 41

Ercross's answer is correct(Weirdly Enough). I have a list of dynamically produced textFields, and I wanted to make them dismissable, upon using the Dismissible Widget it required a key parameter, which when made a const Key('test') made the error go away.

Upvotes: 0

kaleem ullah
kaleem ullah

Reputation: 81

please check your widget you are using textfeild in stateless widget just convert it into stateful widget.

Upvotes: 0

kaleem ullah
kaleem ullah

Reputation: 81

if your are using textformfeild in stateless widget then it give you this error , try to covert stateless widget to Stateful widget.

Upvotes: 2

Ercross
Ercross

Reputation: 646

In my own case, I had this key: ValueKey<int>(math.Random().nextInt(5)), as the key for an ancestor widget of the TextFormField. I removed it and the error no longer appeared. So my debug suggestion is to check all widgets, in the widget tree, that has any value passed for its key argument.

Upvotes: 0

Related Questions