1. 27 Jan, 2021 1 commit
  2. 26 Jan, 2021 1 commit
  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. 16 Sep, 2020 1 commit
  5. 15 Sep, 2020 1 commit
    • Greg Spencer's avatar
      Fix the `character` field of the `RawKeyEvent` to hold correct data on... · 199a7c19
      Greg Spencer authored
      Fix the `character` field of the `RawKeyEvent` to hold correct data on non-Android platforms. (#65667)
      
      This fixes a problem where the character field of the RawKeyEvent was not being set at all for non-Android platforms.
      
      I also updated the key maps, and corrected a problem with the Windows key map where the backquote character wasn't correctly mapped.
      199a7c19
  6. 05 Aug, 2020 1 commit
  7. 16 Jun, 2020 1 commit
  8. 21 Apr, 2020 1 commit
  9. 10 Apr, 2020 2 commits
  10. 08 Apr, 2020 1 commit
  11. 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
  12. 05 Mar, 2020 1 commit
  13. 03 Mar, 2020 1 commit
  14. 26 Feb, 2020 1 commit
    • Greg Spencer's avatar
      Implement VisualDensity for text fields. (#51438) · 9e744c57
      Greg Spencer authored
      This implements VisualDensity changes for text fields*. By default, the layout of the text field does not change.
      
      If the ThemeData.visualDensity is set to a value other than zero, then the density of the UI will increase or decrease. See the VisualDensity docs for more information.
      
      (*In reality, the changes are on the InputDecorator class, not on the text field.)
      
      I also fixed a problem that I think I found with _Decoration where it doesn't compare isDense or isCollapsed as part of its operator==.
      9e744c57
  15. 21 Feb, 2020 1 commit
    • Greg Spencer's avatar
      Fix stuck keys when shift is released before the letter. (#51095) · c5dd3ec4
      Greg Spencer authored
      This fixes a problem where if you press "Shift" and then "A", then release "Shift" and then "a", then the "A" key will be "stuck" on because the logical key for the key down message is different (capital "A") from the logical key for the key up message (lowercase "a").
      
      This PR changes the pressed keys logic so that it uses the physical key to add/remove keys from the list of pressed keys, but keeps the associated logical key.
      
      This does mean that after the "Shift" key goes up, the pressed keys contains a capital "A" and it doesn't switch to be a lowercase "a", but there isn't currently any mechanism we can use to do that remapping. This is far less surprising than the current behavior, but is still not quite correct.
      
      I fixed the event simulation code to take a physicalKey so that it could be matched with the logical key, but the event simulation code isn't up to the task, since it can only simulate keys that appear in the key maps. The new platform key event design should fix that (added TODOs).
      c5dd3ec4
  16. 13 Feb, 2020 1 commit
    • Greg Spencer's avatar
      Reland: Add OrderedFocusTraversalPolicy and FocusTraversalGrou… (#50672) · d57d4935
      Greg Spencer authored
      This re-lands #49235 with the addition of includeSemantics flag on the Focus widget so that the FocusTraversalGroup can create a Focus widget without affecting the semantics tree.
      
      The FocusTraversalGroup uses the Focus widget to create a grouping of descendants for traversal, but doesn't actually participate in focus (canRequestFocus is always false), so we don't want it to add a Semantics widget in that case, since that can cause semantics changes. The canRequestFocus attribute can also be used when a widget is disabled, so we do sometimes want to include Semantics even if that is false, but not in the case where it is always false, as for FocusTraversalGroup.
      
      - Added a test to make sure that FocusTraversalGroup doesn't add any semantics information.
      d57d4935
  17. 12 Feb, 2020 1 commit
  18. 11 Feb, 2020 1 commit
    • Greg Spencer's avatar
      Add OrderedFocusTraversalPolicy and FocusTraversalGroup to all… (#49235) · 8ef5e2f0
      Greg Spencer authored
      This change adds a way to provide explicit focus order for a part of the widget tree.
      
      It adds FocusTraversalPolicyGroup, which in many ways is similar to DefaultFocusTraversal, except that it groups a widget subtree together so that those nodes are traversed as a group. DefaultFocusTraversal doesn't work as one would expect: If there is more than one DefaultFocusTraversal inside of a focus scope, the policy can change depending on which node was asked to move "next", which can cause unexpected behavior. The new grouping mechanism doesn't have that problem. I deprecate DefaultFocusTraversal in this PR.
      
      It also adds OrderedFocusTraversalPolicy, which is a policy that can be supplied to FocusTraversalPolicyGroup to set the policy for a sub-tree. It looks for FocusTraversalOrder inherited widgets, which use a FocusOrder to do the sorting. FocusOrder has two subclasses: NumericalFocusOrder (which sorts based on a double), and LexicalFocusOrder, which sorts based on a String.
      
      As part of doing this, I refactored the way FocusTraversalPolicy is implemented so that it has more default implementation methods, and exposes a new protected member: sortDescendants, which makes it easier for developers to make their own policy subclasses: they only need to implement sortDescendants to get a new ordering behavior, but can also still override any of the default implementation behaviors if they need different behavior.
      
      I was able to do this without breaking the API (AFAICT).
      8ef5e2f0
  19. 31 Jan, 2020 1 commit
  20. 28 Jan, 2020 1 commit
  21. 25 Jan, 2020 1 commit
  22. 24 Jan, 2020 1 commit
  23. 07 Jan, 2020 2 commits
  24. 06 Dec, 2019 1 commit
  25. 05 Dec, 2019 1 commit
  26. 04 Dec, 2019 1 commit
    • Greg Spencer's avatar
      Add a VisualDensity manual test (#46083) · 09927b94
      Greg Spencer authored
      Adds a manual test that allows testing of density for buttons. Also updates some of the button tests to be somewhat simpler and to test the child positions in the test to make sure they are consistent.
      09927b94
  27. 27 Nov, 2019 2 commits
    • 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
    • Greg Spencer's avatar
      Add macOS to TargetPlatform (#43457) · 245d1b51
      Greg Spencer authored
      This PR adds TargetPlatform.macOS to the TargetPlatform enum. This allows us to begin implementation of some adaptive UI based on which target platform is desired.
      
      I haven't updated the tests here, that will come in a follow-up PR.
      245d1b51
  28. 19 Nov, 2019 1 commit
    • Greg Spencer's avatar
      Update manual_tests to be able to run on macOS/web (#44830) · 29ab6b54
      Greg Spencer authored
      I updated the build files for manual_tests, as well as adding in a macos and web directory to allow the manual tests to be run on the web or on desktop.
      
      The main change here are the parts that I added to the files in manual_tests/lib/... (the addition of kIsWeb to "if (!kIsWeb && Platform.isMacOS) {") The rest is just an update of the auto-generated code from flutter create.
      29ab6b54
  29. 01 Nov, 2019 1 commit
    • Greg Spencer's avatar
      Add convenience accessor for primaryFocus (#43859) · 3a30722f
      Greg Spencer authored
      This adds accessors for WidgetsBinding.instance.focusManager and WidgetsBinding.instance.focusManager.primaryFocus so that they can be more easily found in IDEs and accessed.
      
      This adds a top level getter for WidgetsBinding.instance.focusManager.primaryFocus called primaryFocus, and a static accessor FocusManager.instance that returns WidgetsBinding.instance.focusManager.
      3a30722f
  30. 24 Oct, 2019 1 commit
    • Jacek Fedoryński's avatar
      Add repeatCount to RawKeyEventDataAndroid (#42861) · e458fd08
      Jacek Fedoryński authored
      * Add repeatCount to RawKeyEventDataAndroid
      
      Adds a new field to RawKeyEventDataAndroid and sets it to the value
      passed from the engine. It is the value returned by
      KeyEvent.getRepeatCount(). This allows us to differentiate between
      events generated by a new keypress and repeated events when a key is
      held down.
      
      * Add test for RawKeyEventDataAndroid.repeatCount
      e458fd08
  31. 10 Oct, 2019 1 commit
    • Greg Spencer's avatar
      Re-land keyboard traversal PRs (#42278) · ce150971
      Greg Spencer authored
      This attempts to reland #40186 and #41220, that were reverted in #41945.
      
      The main modifications from the original PRs are that I predefine the shortcuts and actions maps instead of defining them inline in the build function, and I use a new mapEquals to do a deep comparison so that we don't rebuild modified things if the contents of the map haven't changed.
      
      I also eliminated an operator== and hashCode that were defined on the Actions widget, since widgets shouldn't have those. (it's too bad though: I get an 85% speedup if we leave this in! Too bad it prevents rebuilding of the children...)
      
      Fixes #40101
      ce150971
  32. 04 Oct, 2019 1 commit
  33. 02 Oct, 2019 1 commit
    • Greg Spencer's avatar
      Add shortcuts and actions for default focus traversal (#40186) · bedf46d0
      Greg Spencer authored
      This adds the default shortcuts and actions for keyboard-based focus traversal of apps.
      
      This list of shortcuts includes shortcuts for TAB, SHIFT TAB, RIGHT_ARROW, LEFT_ARROW, UP_ARROW, DOWN_ARROW, and the four DPAD keys for game controllers (because the DPAD produces arrow key events).
      
      It doesn't yet include functionality for triggering a control (e.g. SPACE, ENTER, or controller buttons), because that involves restructuring some of the Flutter controls to trigger animations differently, and so will be done in another PR (#41220)
      bedf46d0
  34. 28 Sep, 2019 1 commit
  35. 27 Sep, 2019 2 commits
  36. 25 Sep, 2019 1 commit
    • Greg Spencer's avatar
      Desktop manual tests (#41247) · 9749f59c
      Greg Spencer authored
      This enables the manual tests to be built on a macOS desktop machine in desktop mode.
      
      I created the macos directory by using flutter create --macos
      9749f59c