In screen B, there is a TextField with leading back icon on AppBar, when the user taps the leading "back" icon to return to screen A while the keyboard is open, it closes the keyboard and returns to screen A as expected, but there is a small glitch in screen A, it looks like the keyboard is not completely dismissed. its look like small vibration, disturbance on UI.
I tried to make a little adjustment with this code :
onPressed: () async {
FocusScope.of(context).unfocus();
await Future.delayed(const Duration(milliseconds: 300));
Navigator.maybePop(context);
},
And the glitches on screen A are gone. but this method makes use of the context between async gaps which is not recommended by dart, any other way to solve this? Thank you in advance.