We all have faced situations after filling the text field the virtual keyboard does not go away automatically. We have to click on the back button of our smartphones to remove the virtual keyboard. So in this article, we will see how to dismiss the virtual keyboard in an app with just one tap.
For this, we will be using the onTap() property of the Flutter UI Gesture Detection.
Follow the below steps to implement the above-discussed feature:
Step1: Use the Gesture detector onTap() property.
Step 2: Set onTap to unfocus using the unfocus() method.
Take a look at the below example. Comments have been added to the code for reference.
Please Login to comment...