1. 25 Apr, 2019 1 commit
    • Greg Spencer's avatar
      [Re-Land] Implement focus traversal for desktop platforms. (#31614) · 7775c237
      Greg Spencer authored
      This re-lands the Focus changes in #30040. Correctness changes in routes.dart, and removes the automatic requesting of focus on reparent when there is no current focus, which caused undesirable selections.
      
      Addresses #11344, #1608, #13264, and #1678
      Fixes #30084
      Fixes #26704
      7775c237
  2. 23 Apr, 2019 1 commit
  3. 22 Apr, 2019 1 commit
    • Greg Spencer's avatar
      Implement focus traversal for desktop platforms, shoehorn edition. (#30040) · 4218c0bc
      Greg Spencer authored
      Implements focus traversal for desktop platforms, including re-implementing the existing focus manager and focus tree.
      
      This implements a Focus widget that can be put into a widget tree to allow input focus to be given to a particular part of a widget tree.
      
      It incorporates with the existing FocusScope and FocusNode infrastructure, and has minimal breakage to the API, although FocusScope.reparentIfNeeded is removed, replaced by a call to FocusAttachment.reparent(), so this is a breaking change:
      
      FocusScopeNodes must now be attached to the focus tree using FocusScopeNode.attach, which takes a context and an optional onKey callback, and returns a FocusAttachment that should be kept by the widget that hosts the FocusScopeNode. This is necessary because of the need to make sure that the focus tree reflects the widget hierarchy.
      
      Callers that used to call FocusScope(context).reparentIfNeeded in their build method will call reparent  on a FocusAttachment instead, which they will obtain by calling FocusScopeNode.attach in their initState method. Widgets that own FocusNodes will need to call dispose on the focus node in their dispose method.
      
      Addresses #11344, #1608, #13264, and #1678
      Fixes #30084
      Fixes #26704
      4218c0bc
  4. 20 Mar, 2019 1 commit
    • Alexandre Ardhuin's avatar
      some spaces formatting (#29452) · a6af4228
      Alexandre Ardhuin authored
      * some space formattings
      
      * always use blocks in if-else if a block is used
      
      * format spaces in for and while
      
      * allow multiline if conditions
      
      * fix missing space
      a6af4228
  5. 08 Mar, 2019 1 commit
    • Greg Spencer's avatar
      Add/rewrite tests for FocusScope. (#28169) · 89512e46
      Greg Spencer authored
      In anticipation of changing a lot of the focus code, I'm adding some tests for the FocusScope.
      
      As a result, I was able to find and fix a bug where there was an incorrect assert.
      
      I also added some more documentation.
      
      Several of the tests enforce what I think is incorrect behavior related to passing focus off when the widget tree gets rebuilt without focus nodes that were previously there, but I'm not going to change that behavior in this PR.
      
      I also renamed focus_test.dart to focus_scope_test.dart to be more in line with our naming conventions.
      89512e46
  6. 05 Feb, 2019 1 commit
  7. 14 Dec, 2018 2 commits
  8. 12 Sep, 2018 1 commit
  9. 20 Mar, 2018 1 commit
  10. 01 Feb, 2018 1 commit
  11. 22 Oct, 2017 1 commit
  12. 21 Sep, 2017 1 commit
  13. 11 Sep, 2017 1 commit
  14. 03 Aug, 2017 1 commit
  15. 25 Jul, 2017 1 commit
  16. 23 Jun, 2017 1 commit
  17. 21 Jun, 2017 3 commits
  18. 05 May, 2017 1 commit
  19. 24 Apr, 2017 1 commit
    • Adam Barth's avatar
      FocusNode.requestFocus should show the keyboard (#9558) · 55f33468
      Adam Barth authored
      This patch introduces the notion of a keyboard token, which generalizes the
      logic in EditableText for distinguishing between gaining focus by default and
      gaining focus because of an explicit use action.
      
      Fixes #7985
      55f33468
  20. 07 Apr, 2017 1 commit
  21. 05 Apr, 2017 1 commit
  22. 31 Mar, 2017 1 commit
    • Adam Barth's avatar
      Improve focus management (#9074) · 89aaaa9c
      Adam Barth authored
      We now have an explicit focus tree that we manage. Instead of using
      GlobalKeys to manage focus, we use FocusNode and FocusScopeNode objects.
      The FocusNode is Listenable and notifies when its focus state changes.
      
      Focus notifications trigger by tree mutations are now delayed by one
      frame, which is necessary to handle certain complex tree mutations. In
      the common case of focus changes being triggered by user input, the
      focus notificiation still arives in the same frame.
      89aaaa9c