isOpen static method

bool isOpen(
  1. BuildContext context
)

Whether the keyboard is currently open. Requires a Keyboard ancestor. Example usage:

bool isOpen = Keyboard.isOpen(context);

Implementation

static bool isOpen(BuildContext context) {
  //
  final scope = context.dependOnInheritedWidgetOfExactType<_KeyboardScope>();
  assert(
    scope != null,
    'Keyboard.isOpen() called without a Keyboard ancestor. '
    'Wrap the app (above any Scaffold) in a Keyboard widget.',
  );
  return scope!.isOpen;
}