isKeyboardVisible static method

bool isKeyboardVisible(
  1. BuildContext context
)

Returns true if the keyboard is currently visible, false if the keyboard is not currently visible, or null if the flutter_keyboard_visibility plugin does not yet know if the keyboard is visible.

This method also establishes an InheritedWidget dependency with the given context, and therefore the given context will automatically rebuild if the keyboard visibility changes.

Implementation

static bool isKeyboardVisible(BuildContext context) {
  return context
      .dependOnInheritedWidgetOfExactType<
          _KeyboardVisibilityInheritedWidget>()!
      .isKeyboardVisible;
}