1. 05 Jan, 2021 1 commit
  2. 29 Oct, 2020 1 commit
    • Greg Spencer's avatar
      Remove nullOk parameter from Shortcuts.of, Actions.find, and Actions.handler (#68921) · 4f586fa3
      Greg Spencer authored
      This removes the nullOk parameter from Shortcuts.of, Actions.find and Actions.handler and created Shortcuts.maybeOf and Actions.maybeFind. Shortcuts.of and Actions.find now return non-nullable values, and the maybe versions return a nullable value. I didn't create a non-nullable version of Actions.handler, since it needs to be able to return null if an action is not enabled, but I did remove the nullOk parameter, effectively setting it to true permanently, since setting it to false doesn't make much sense if the function can still return null when the action is not enabled.
      4f586fa3
  3. 19 Oct, 2020 1 commit
    • Greg Spencer's avatar
      Mark keys that match a shortcut, but have no action defined as "not handled". (#67359) · 8c03ff8c
      Greg Spencer authored
      - - When I added notification of key events before processing them as text, it made it so that shortcut key bindings like the spacebar would prevent spaces from being inserted into text fields, which is obviously not desirable (and so that change was reverted). At the same time, we do want to make it possible to override key events so that they can do things like intercept a tab key or arrow keys that change the focus.
      
      This PR changes the behavior of the Shortcuts widget so that if it has a shortcut defined, but no action is bound to the intent, then instead of responding that the key is "handled", it responds as if nothing handled it. This allows the engine to continue to process the key as text entry.
      
      This PR includes:
      
      - Modification of the callback type for key handlers to return a KeyEventResult instead of a bool, so that we can return more information (i.e. the extra state of "stop propagation").
      - Modification of the ActionDispatcher.invokeAction contract to require that Action.isEnabled return true before calling it. It will now assert if the action isn't enabled when invokeAction is called. This is to allow optimization of the number of calls to isEnabled, since the shortcuts widget now wants to know if the action was enabled before deciding to either handle the key or to return ignored.
      - Modification to ShortcutManager.handleKeypress to return KeyEventResult.ignored for keys which don't have an enabled action associated with them.
      - Adds an attribute to DoNothingAction that allows it to mark a key as not handled, even though it does have an action associated with it. This will allow disabling of a shortcut for a subtree.
      8c03ff8c
  4. 15 Oct, 2020 1 commit
  5. 11 Jun, 2020 1 commit
  6. 03 Jun, 2020 1 commit
  7. 07 Apr, 2020 1 commit
    • Greg Spencer's avatar
      Revise Action API (#42940) · 0f68b46f
      Greg Spencer authored
      This updates the Action API in accordance with the design doc for the changes: flutter.dev/go/actions-and-shortcuts-design-revision
      
      Fixes #53276
      0f68b46f
  8. 06 Apr, 2020 1 commit
  9. 20 Mar, 2020 1 commit
  10. 30 Jan, 2020 1 commit
  11. 13 Jan, 2020 1 commit
  12. 09 Jan, 2020 1 commit
    • Greg Spencer's avatar
      Simplify the Shortcuts widget diagnostic output (#48265) · 1df6e2af
      Greg Spencer authored
      This simplifies the diagnostic output for the Shortcuts widget so that if a debugLabel is supplied, then that is printed instead of the full list of shortcut keys in the map. Also, the output of the shortcut map is simplified to have the list of keys presented in more readable text.
      1df6e2af
  13. 27 Nov, 2019 1 commit
    • Ian Hickson's avatar
      License update (#45373) · 449f4a66
      Ian Hickson authored
      * Update project.pbxproj files to say Flutter rather than Chromium
      
      Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.
      
      * Update the copyright notice checker to require a standard notice on all files
      
      * Update copyrights on Dart files. (This was a mechanical commit.)
      
      * Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.
      
      Some were already marked "The Flutter Authors", not clear why. Their
      dates have been normalized. Some were missing the blank line after the
      license. Some were randomly different in trivial ways for no apparent
      reason (e.g. missing the trailing period).
      
      * Clean up the copyrights in non-Dart files. (Manual edits.)
      
      Also, make sure templates don't have copyrights.
      
      * Fix some more ORGANIZATIONNAMEs
      449f4a66
  14. 30 Sep, 2019 1 commit
  15. 28 Sep, 2019 1 commit
  16. 27 Sep, 2019 2 commits
  17. 24 Sep, 2019 2 commits
    • Alexandre Ardhuin's avatar
      fix some bad indentations (#41172) · b8731621
      Alexandre Ardhuin authored
      b8731621
    • Greg Spencer's avatar
      Add fake keyboard key generation to the testing framework (#40706) · 0e6cb28d
      Greg Spencer authored
      There were four or five different implementations in various tests for sendFakeKeyEvent, which roughly all did the same thing. I was going to add yet another one, and decided that it needed to be generalized and centralized. This replaces those instances with something that just takes a LogicalKeyboardKey so that it's self-documenting, and can be used with multiple platforms.
      
      This adds two functions to widget tester: sendKeyDownEvent and sendKeyUpEvent which simulate key up/down from a physical keyboard. It also adds global functions simulateKeyDownEvent and simulateKeyUpEvent that can be called without a widget tester. All are async functions protected by the async guard.
      0e6cb28d
  18. 23 Aug, 2019 1 commit
    • Greg Spencer's avatar
      Fix KeySet<T> (and LogicalKeySet, PhysicalKeySet) hashCode calculation (#38936) · 055c5489
      Greg Spencer authored
      This fixes the hashCode calculation for KeySet<T> so that it doesn't depend on the insertion order of the keys in the set.
      
      The fix involves switching from Set<T> to HashSet<T> internally, so that the iteration order is stable around the hash values of the inserted keys, and not the insertion order. This matters when hashList is called in KeySet<T>.hashCode to build the hash value of the contents of the internal set.
      
      Fixes #38919
      055c5489
  19. 21 Aug, 2019 1 commit
  20. 09 Aug, 2019 2 commits
  21. 06 Jun, 2019 1 commit
  22. 04 Jun, 2019 1 commit
    • Greg Spencer's avatar
      Add actions and keyboard shortcut map support (#33298) · 387e2b06
      Greg Spencer authored
      This implements the keyboard shortcut handling and action invocation in order to provide a place in the infrastructure for keyboard events to trigger actions. This will allow binding of key events to actions like "move the focus to the next widget" and "activate button".
      387e2b06