Step 1
Create a variable
bool _keyboardVisible = false;
in StatefullWidget
Step 2
Then initialize that variable in the build
widget;
@override
Widget build(BuildContext context) {
_keyboardVisible = MediaQuery.of(context).viewInsets.bottom != 0;
return child;
}
Top comments (0)