When there is content in TextField, if tap the TextField, keyboard will shows up, and that's OK. But when dimiss the keyboard by pressing back button or dismissing button in keyboard, keyboard will be hidden, and then shows up again automatically.
Flutter Version: 1.22.5
Dart Version: 2.10.4
Cellphone: xiaomi 8(Android 10)
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
SizedBox(height: 80),
TextField(
onChanged: (value){
print('$value');
},
)
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}