Also, I had a question about flutter_test matchers and our style guide
says that when I have a question I should update the docs so I did
that and then got a bit carried away.
Fixes https://github.com/flutter/flutter/issues/8476
More detailed list of changes in this patch:
* Replaced the didTouch special logic with more generic logic that
uses Activities instead. Now instead when you tap down the
Scrollable calls `hold()` which begins a HoldScrollActivity which is
a hybrid of DragStartDetails and IdleScrollActivity and can be
canceled. When you let go, it gets canceled and that goes ballistic.
* Make DragGestureRecognizer more aggressive about grabbing pointers,
otherwise a second pointer in a situation with competing horizontal
and vertical recognizers always gets taken by the other one.
* Fixed the _GestureSemantics widget to call the "down" callbacks so
that it follows the same pattern as "real" interactions.
* Added tests for the above.
* Added a hashCode to ScrollActivity.toString (and subclasses).
* Added a toString to ScrollDragController, and include it in
DragScrollActivity's toString.
* s/coorindator/coordinator/
* Add a comment in DragStartDetails to distinguish it from the
otherwise identical DragDownDetails, so we're not tempted to merge
them.
Eliminates Gallery-specific hardcoding of app package and activity name
in the test.
Fixes breakage introduced with 1dc2d4eb430663d3163cc356b091e7415da5ef56
due to main activity class now being MainActivity.
This splits the frame pipeline into two, beginFrame and drawFrame.
As part of making this change I added some debugging hooks that helped
debug the issues that came up:
* I added debugPrintScheduleFrameStacks which prints a stack whenever
a frame is actually scheduled, so you can see why frames are being
scheduled.
* I added some toString output to EditableText and RawKeyboardListener.
* I added a scheduler_tester.dart library for scheduler library tests.
* I changed the test framework to flush microtasks before pumping.
* Some asserts that had the old string literal form were replaced by
asserts with messages.
I also fixed a few subtle bugs that this uncovered:
* setState() now calls `ensureVisualUpdate`, rather than
`scheduleFrame`. This means that calling it from an
AnimationController callback does not actually schedule an extra
redundant frame as it used to.
* I corrected some documentation.
* Adjust the defaults behaviour of scroll views.
Now, primary scroll views scroll by default. Others only scroll if necessary.
* apply suggested changes