[material/menu_anchor.dart] Remove unused early key event listener (#150915)

Removes an unused block of code (I think -- I could be wrong but it does not appear to have any effect).
This commit is contained in:
davidhicks980 2024-07-31 18:47:59 -04:00 committed by GitHub
parent 303cbb7cde
commit d62069ff37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -544,14 +544,6 @@ _MenuAnchorState? get _previousFocusableSibling {
}
}
KeyEventResult _checkForEscape(KeyEvent event) {
if (event is KeyDownEvent && event.logicalKey == LogicalKeyboardKey.escape) {
_close();
return KeyEventResult.handled;
}
return KeyEventResult.ignored;
}
/// Open the menu, optionally at a position relative to the [MenuAnchor].
///
/// Call this when the menu should be shown to the user.
@ -592,9 +584,6 @@ _MenuAnchorState? get _previousFocusableSibling {
if (!_isOpen) {
return;
}
if (_isRoot) {
FocusManager.instance.removeEarlyKeyEventHandler(_checkForEscape);
}
_closeChildren(inDispose: inDispose);
// Don't hide if we're in the middle of a build.
if (SchedulerBinding.instance.schedulerPhase != SchedulerPhase.persistentCallbacks) {