addKeyObserver method

KeyPhaseObserverRegistration addKeyObserver(
  1. void observer(
    1. KeyEvent event
    ), {
  2. FocusNode? anchor,
})

Registers observer on the observation lane, scoped to the active focus subtree of anchor (null = app-wide). Framework-internal.

Implementation

KeyPhaseObserverRegistration addKeyObserver(
  void Function(KeyEvent event) observer, {
  FocusNode? anchor,
}) {
  _checkNotDisposed();
  final registration = KeyPhaseObserverRegistration._(this, observer, anchor);
  _keyObservers.add(registration);
  return registration;
}