• Greg Spencer's avatar
    Add key event handlers that happen before or after the focus traversal (#136280) · 7e1d366a
    Greg Spencer authored
    ## Description
    
    This adds a mechanism for listening to key events before or after focus traversal occurs.
    
    It adds four methods to the public `FocusManager` API:
    
    - `addEarlyKeyEventHandler` - Adds a handler that can handle events before they are given to the focus tree for handling.
    - `removeEarlyKeyEventHandler` - Removes an early event handler.
    - `addLateKeyEventHandler` - Adds a handler that can handle events if they have not been handled by anything in the focus tree.
    - `removeLateKeyEventHandler` - Removes a late event handler.
    
    This allows an app to get notified for a key anywhere, and prevent the focus tree from seeing that event if it handles it.
    
    For the menu system, this allows it to eat an escape key press and close all the open menus.
    
    ## Related Issues
     - https://github.com/flutter/flutter/issues/135334
    
    ## Tests
     - Added tests for new functionality.
    7e1d366a
Name
Last commit
Last update
..
fix_data Loading commit data...
src Loading commit data...
analysis_options.yaml Loading commit data...
analysis_options_user.yaml Loading commit data...
animation.dart Loading commit data...
cupertino.dart Loading commit data...
foundation.dart Loading commit data...
gestures.dart Loading commit data...
material.dart Loading commit data...
painting.dart Loading commit data...
physics.dart Loading commit data...
rendering.dart Loading commit data...
scheduler.dart Loading commit data...
semantics.dart Loading commit data...
services.dart Loading commit data...
widgets.dart Loading commit data...