Flutter – How to get keyboard height

When building UI in Flutter, sometimes we need to get keyboard height to update the UI accordingly. In this post, I will share with you a simple method to get soft keyboard height using MediaQuery.

double getKeyboardHeight(BuildContext context) {
  return MediaQuery.of(context).viewInsets.bottom;
}

Just that!

Tagged : / / / /
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x