1. 16 May, 2019 1 commit
    • Greg Spencer's avatar
      Fix Focus.of to not find FocusScope nodes. (#32826) · 3c16cf6a
      Greg Spencer authored
      Until this change, Focus.of would return a FocusScopeNode if it found a FocusScope widget. This isn't really all that useful, and can easily lead to bad situations where many widgets think that the scope they are in (or the root scope!) is their indication of being focused.
      
      This changes Focus.of to throw an exception if it doesn't find a Focus widget before reaching the nearest FocusScope widget, or the root of the widget hierarchy.
      
      It also adds a nullOk optional bool to Focus.of so that if a caller expects to not find a Focus widget, it can deal with that as it sees fit. I modified InkWell to use this new behavior.
      
      This fixes an unreported issue that widgets using an InkWell will be drawn as focused the first time they are visited.
      3c16cf6a
  2. 15 May, 2019 1 commit
    • Greg Spencer's avatar
      Implements focus handling and hover for Material buttons. (#31438) · bb3c6605
      Greg Spencer authored
      This implements focus and hover handling for Material buttons. It inserts Focus widgets into the tree in order to allow buttons to be focusable via keyboard traversal (a.k.a. TAB traversal), and Listener widgets into the InkWell to allow the detection of hover states for widgets.
      
      Addresses #11344, #1608, and #13264.
      bb3c6605
  3. 10 May, 2019 1 commit
  4. 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
  5. 23 Apr, 2019 1 commit
  6. 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
  7. 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
  8. 05 Feb, 2019 1 commit
  9. 12 Sep, 2018 1 commit
  10. 16 Jul, 2018 1 commit
  11. 05 Jun, 2018 1 commit
  12. 03 May, 2018 1 commit
  13. 21 Dec, 2017 1 commit
  14. 04 Dec, 2017 1 commit
    • krisgiesing's avatar
      Separate focus management by build owner (#13334) · 898646f0
      krisgiesing authored
      Separate focus management by build owner
      
      Currently the focus manager is held by the singleton WidgetBinding.
      This change places a focus manager in each build owner object,
      which allows clients to run offscreen pipelines without disturbing
      focus management for the main UI.
      898646f0
  15. 18 Oct, 2017 1 commit
    • Michael Goderbauer's avatar
      Redesign Semantic Tree Compilation Algorithm (#12605) · f8a2bd20
      Michael Goderbauer authored
      * Oct 12 10:12am
      
      * implicit_semantics_test.dart passes
      
      * refactoring
      
      * works in nice
      
      * minor rename
      
      * more doc comments
      
      * to be explicit check better
      
      * fix test
      
      * ++
      
      * ++
      
      * semantics_9_test (BlockSemantics) and implicit_semantics_test are passing
      
      * doc updates
      
      * tiny refactor
      
      * fix static errors in tests
      
      * fix gesture detector
      
      * ++
      
      * ++
      
      * geometry
      
      * ++
      
      * remove noGeometry
      
      * revert test
      
      * +
      
      * all tests but scrolling/clipping pass
      
      * clipping works
      
      * scrolling halfway
      
      * sliver tests pass
      
      * ALL TESTS PASS
      
      * SemanticsNode changed
      
      * docs and tiny fixes
      
      * card test
      
      * more doc comments
      
      * remove missed print
      
      * more tests
      
      * make test pass on Linux
      
      * remove changes to intellij proj file
      
      * review comments
      f8a2bd20
  16. 23 Apr, 2017 1 commit
  17. 11 Apr, 2017 1 commit
    • xster's avatar
      Rename State.config to widget everywhere (#9273) · 89a7fdfc
      xster authored
      Rename State.config to State.widget
      Rename State.didUpdateConfig to State.didUpdateWidget
      Renamed all State subclasses' local variables named config to something else
      89a7fdfc
  18. 05 Apr, 2017 1 commit
  19. 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