addKeyObserver method
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;
}