1. 03 Aug, 2022 1 commit
  2. 15 Jun, 2022 1 commit
  3. 20 May, 2022 1 commit
  4. 17 May, 2022 1 commit
    • Greg Spencer's avatar
      Add VoidCallbackAction and VoidCallbackIntent (#103518) · 19940279
      Greg Spencer authored
      This adds a simple VoidCallbackAction and VoidCallbackIntent that allows configuring an intent that will invoke a void callback when the intent is sent to the action subsystem. This allows binding a shortcut directly to a void callback in a Shortcuts widget.
      
      I also added an instance of VoidCallbackAction to the default actions so that simply binding a shortcut to a VoidCallbackIntent works anywhere in the app, and you don't need to add a VoidCallbackAction at the top of your app to make it work.
      19940279
  5. 27 Apr, 2022 1 commit
  6. 14 Apr, 2022 1 commit
  7. 03 Feb, 2022 1 commit
  8. 10 Jan, 2022 1 commit
  9. 14 Dec, 2021 1 commit
  10. 08 Oct, 2021 3 commits
  11. 10 Aug, 2021 1 commit
  12. 15 Jul, 2021 1 commit
  13. 14 Jul, 2021 3 commits
  14. 13 Jul, 2021 2 commits
  15. 28 Apr, 2021 1 commit
  16. 26 Apr, 2021 1 commit
  17. 07 Apr, 2021 1 commit
  18. 17 Mar, 2021 1 commit
  19. 04 Mar, 2021 2 commits
  20. 26 Jan, 2021 1 commit
    • Greg Spencer's avatar
      Remove nullOk from Actions.invoke, add Actions.maybeInvoke (#74680) · 2eeeba9c
      Greg Spencer authored
      This removes the nullOk parameter from Actions.invoke, and adds an Actions.maybeInvoke function. The difference is that invoke will now always (in debug mode) throw if an enabled action isn't found, and maybeInvoke will return null if an enabled action isn't found. The invoke function can still return null as the result of the invocation, though, so I purposely didn't change the return value to Object from Object?.
      2eeeba9c
  21. 13 Nov, 2020 1 commit
  22. 12 Nov, 2020 1 commit
  23. 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
  24. 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
  25. 07 Oct, 2020 1 commit
  26. 23 Jul, 2020 1 commit
  27. 09 Jul, 2020 1 commit
  28. 11 Jun, 2020 1 commit
  29. 29 May, 2020 1 commit
  30. 28 May, 2020 1 commit
  31. 27 May, 2020 1 commit
    • Greg Spencer's avatar
      Add MediaQueryData.navigationMode and allow controls to be focused when disabled. (#54919) · 8ef29154
      Greg Spencer authored
      This adds a new navigationMode to the MediaQueryData that indicates how focusable controls should behave under different navigation modes, currently with two modes: NavigationMode.traditional, and NavigationMode.directional.
      
      It may seem like focusing a disabled control is not desirable, but this is useful for user interfaces that use DPAD navigation because if a control gets disabled, losing focus is disruptive to the user, and it is difficult to control where the focus will end up unless it is done explicitly.
      8ef29154
  32. 21 Apr, 2020 1 commit
  33. 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
  34. 11 Feb, 2020 1 commit