KeyboardListener constructor

const KeyboardListener(
  1. {Key? key,
  2. required FocusNode focusNode,
  3. bool autofocus = false,
  4. bool includeSemantics = true,
  5. ValueChanged<KeyEvent>? onKeyEvent,
  6. required Widget child}

Creates a widget that receives keyboard events.

For text entry, consider using a EditableText, which integrates with on-screen keyboards and input method editors (IMEs).

The key is an identifier for widgets, and is unrelated to keyboards. See Widget.key.


const KeyboardListener({
  required this.focusNode,
  this.autofocus = false,
  this.includeSemantics = true,
  required this.child,