1. 30 May, 2019 3 commits
    • Todd Volkert's avatar
      Remove assert from Image._handleImageFrame() (#33602) · cba41ca2
      Todd Volkert authored
      Tickers being disabled and re-enabled can cause the
      condition of a synchronous notification happening after
      image frames have been delivered, which is valid in that
      case. As such, this removes the assert.
      
      https://github.com/flutter/flutter/issues/32374
      cba41ca2
    • Greg Spencer's avatar
      Fix onExit calling when the mouse is removed. (#33477) · 07aede4c
      Greg Spencer authored
      This PR solves two problems: currently, the onExit is called for a mouse pointer the moment the removal message is received, except that by the time it actually calls it, there is no _lastEvent for it in the mouse tracker (it's already been removed), resulting in an event being passed to the onExit that contains nulls for the position. Also, removePointer events don't actually get created with a position, although they easily could be, so that even the the _lastEvent in the mouse tracker were still populated, it would still give a null position and delta.
      
      This PR adds support for the position and delta in a PointerRemovedEvent, and populates them. In addition, when a remove event is received, it doesn't actually remove the pointer until the mouse position check that gets scheduled actually happens.
      07aede4c
    • chunhtai's avatar
  2. 29 May, 2019 2 commits
    • LongCatIsLooong's avatar
      Fix ScrollbarPainter thumbExtent calculation and add padding (#31763) · 22ea031e
      LongCatIsLooong authored
      - Fixed extentInside calculation in ScrollMetrics
      - Added asserts to extentInside getter, as well as ScrollPosition.applyContentDimensions to enforce minScrollExtent <= maxScrollExtent
      - Added padding to ScrollbarPainter, updated implementation. Took care of some edge cases.
      - Changed some scroll bar constants on Cupertino side.
      22ea031e
    • Todd Volkert's avatar
      Add loading support to Image (#33369) · 68841469
      Todd Volkert authored
      This adds two new builders to the `Image` class:
      
      * `frameBuilder`, which allows callers to control the widget
        created by an [Image].
      * `loadingBuilder`, which allows callers fine-grained control
        over how to display loading progress of an image to the user.
      
      `FadeInImage` can be simplified by migrating to the new API.
      This is done in a follow-on commit.
      
      https://github.com/flutter/flutter/issues/32374
      68841469
  3. 28 May, 2019 2 commits
  4. 25 May, 2019 1 commit
    • Chris Bracken's avatar
      Americanise spellings (#33323) · 156b4220
      Chris Bracken authored
      Updates documentation and non-public API to use American spellings for
      consistency with the rest of the codebase.
      
      No changes to behaviour... other than how it's spelt.
      156b4220
  5. 21 May, 2019 2 commits
    • Greg Spencer's avatar
      A minor bug fix and comment cleanups for focus (#33135) · a389d177
      Greg Spencer authored
      This just fixes up some comments for DefaultFocusTraversal, and fixes a minor bug when setting the onKey on a FocusNode on creation before attaching to it.
      a389d177
    • Todd Volkert's avatar
      Add some sanity to the ImageStream listener API (#32936) · 592f81e7
      Todd Volkert authored
      The current API was broken in that you registered multiple
      callbacks at once, but when you removed listeners, only the
      primary listener was used to determine what was removed.
      This led to unintuitive cases where the caller could get
      unexpected behavior.
      
      This updates the API to add and remove listeners using
      a newly introduced [ImageStreamListener] object, a value
      object that has references to the individual callbacks
      that may fire.
      
      flutter/flutter#24722
      flutter/flutter#32374
      flutter/flutter#32935
      592f81e7
  6. 20 May, 2019 1 commit
  7. 16 May, 2019 3 commits
    • chunhtai's avatar
    • Alexandre Ardhuin's avatar
      use null aware operators (#32711) · 4fa32df1
      Alexandre Ardhuin authored
      * use null aware operators
      
      * rollback changes about null-aware operator
      
      * disable lint prefer_is_not_empty
      4fa32df1
    • 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
  8. 15 May, 2019 4 commits
  9. 14 May, 2019 4 commits
  10. 13 May, 2019 1 commit
    • Greg Spencer's avatar
      Fix transforms for things with RenderPointerListeners (#32535) · a5053bfb
      Greg Spencer authored
      This fixes #32525, because it now marks the compositing bits as needing to be recalculated if the mouse tracker changes its idea of whether or not a mouse is attached.
      
      This bug occurred because the test framework was leaking state from one test to the next (the state about whether a mouse pointer was active), and so even though there was a "passing" test when run in order with the other tests in the file, when the test was run individually (or first), it would have failed and caught the bug.
      
      This adds an assert to make sure that after each test there are no simulated mouse pointers connected, and now calls removePointer in all of the tests where this was a problem.
      a5053bfb
  11. 10 May, 2019 3 commits
  12. 09 May, 2019 3 commits
    • Phil Quitslund's avatar
      More const conversions (#32408) · 3a6acb8c
      Phil Quitslund authored
      * update immutable to const
      
      * => const lists
      
      * revert making list const
      
      * make Centers const
      3a6acb8c
    • Phil Quitslund's avatar
      make immutables const (#32340) · d96c1c88
      Phil Quitslund authored
      * make immutables const
      d96c1c88
    • Greg Spencer's avatar
      Fix nested listeners so that ancestor listeners can also receive enter/exit/move events. (#32350) · aeccd6a8
      Greg Spencer authored
      This changes Listener to trigger enter/move/exit in all Listeners below the pointer, not just the leaf region (the first region hit). This is because we need to allow listeners to be nested so that, say, a widget that handles changing color on hover, but also is wrapped in a Tooltip (that handles hover) can trigger both actions, not just one.
      
      To that end, I added a findAll to Layer, similar to the existing find method that was previously used. It returns an iterator over annotated layers which match the given data type.
      
      Since the findAll is implemented as returning an Iterable (and is sync*), I re-implemented the find routines as just returning the first result from findAll, since that should be just as efficient, and would then prevent duplication in the implementation.
      aeccd6a8
  13. 08 May, 2019 1 commit
    • Greg Spencer's avatar
      Fix RenderPointerListener so that callbacks aren't called at the wrong time. (#32142) · 23baae0e
      Greg Spencer authored
      I recently added some code to keep hover events from being propagated when a mouse wasn't attached. While that works, there are times when it can fire callbacks during the building of other components, since they can now be called from detach/attach. This is not ideal, since it will assert then. This changes the code so that it won't update the annotations during attach/detach, but also won't push the annotation layer unless a mouse is connected, achieving the same result as before, but with better semantics.
      
      The basic problem is that in the detach for RenderPointerListener, it would detach the annotation, which could cause onExit to be called on the annotation, since the widget was disappearing under the mouse, and thus needs to receive an onExit, but that onExit might be (and probably will be) calling setState, which marks the owning widget as needing to be built, sometimes when it already has been.
      
      The fix creates a new _ListenerElement that overrides activate and deactivate in order to tell the render object ahead of the detach that it might be detached, and so the onExit gets called before the detach instead of during it.
      
      In addition, I now avoid scheduling more than one check for mouse positions per frame.
      23baae0e
  14. 06 May, 2019 4 commits
  15. 03 May, 2019 2 commits
  16. 02 May, 2019 4 commits