Like many of you I fell in love with flutter as soon as I started working with it. I fell into the hype immediately, however as much as I love flutter it does have its limits.
No one ever really talks about that and what ends up happening is these drawbacks and limitations usually show up when you are well into a project.
The good news is there is usually a workaround to what ever issue you are facing.
A common thing to have in any app is a Input Field, specifically a Text Field. We have all used a textfield before. You just tap into the text field, type some stuff, and hit done. But what if you dont hit done? What if you just tap out side of the Text Field? Well by default, nothing really happens, tapping outside of the text field does not hide your keyboard.
So although this is a common functionality your users might be surprised to tap outside of a text field and have nothing happen. However the workaround for this is pretty easy to implement, just see below.
As you can see in the above code all we need to do is have the following Widget Structure “Scaffold->GestureDetector->ListView->TextField
With that you should now be able to simply tap outside of the TextField and your on-screen keyboard should go away.
Hope you enjoyed and found some value in this tutorial.