KeyboardListenerModifier constructor

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

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 focusNode and child arguments are required and must not be null.

The autofocus argument must not be null.

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

Implementation

const KeyboardListenerModifier({
  super.child,
  super.modifierKey,
  required this.focusNode,
  this.autofocus = false,
  this.includeSemantics = true,
  this.onKeyEvent,
}) : super(key: modifierKey);