How can I listen whether the keyboard is showing up or hiding?
I tried this example How to listen to keyboard on screen Flutter?
void _listener(){
if(_myNode.hasFocus){
// keyboard appeared
}else{
// keyboard dismissed
}
}
FocusNode _myNode = new FocusNode()..addListener(_listner);
TextField _myTextField = new TextField(
focusNode: _mynNode,
...
...
);
But unfortunately it doesn't work. Any ideas how it could be possible to listen to the keyboard change?
It seems like it works when I press "Done" on the keyboard. But if i press back on my phone it won't go to "keyboard dismissed" because the focus still exists.. Any help?