A flow layout is optimized for reposition children with transformation
matrices. A flow layout can animate the position of its children very
efficiently.
Prior to this patch, we were pushing two frames each time the cursor blinked.
In turning the cursor on or off, the markNeedsPaint call was triggering another
frame to be scheduled because we cleared a bit in the scheduler at the
beginning of the frame instead of at the end of the frame.
To implement scheduling correctly, we actually need two bits: one for
ensureVisualUpdate, which just promises to get to the end of the pipeline soon,
and scheduleFrame, which promises to get to the beginning of the pipeline soon.
(Reland)
This adds in particular the ability to track the time at which the
framework boots up, and the time at which we are confident we have
completed the first useful frame.
This reorders some classes so that this file makes more sense, and adds
a bunch of docs. It also makes the following changes:
* Move allElements from Instrumentation to TestWidgets. (Instrumentation
is going away.)
* Remove findElements.
* Rename byElement to byElementPredicate
* Rename byPredicate to byWidgetPredicate
* Implement _WidgetPredicateFinder so that byWidgetPredicate has good
messages
* Fix one use of byElementPredicate to use byWidgetPredicate.
Previously the widgets layer only provided a concrete binding, which
makes it awkward to extend it compared to other bindings. This moves
widgets to the same style as the other layers.
In a subsequent patch I'll use this to make the tests layer saner.
Moves TestGesture into test_pointer.dart and makes it more
self-contained.
This is part of a general refactoring of flutter_test.
Depends on https://github.com/flutter/flutter/pull/3459
This only works for apps which use WidgetsApp. Apps which don't
(like the game) could presumably read the static themselves
off of WidgetsApp.
@devoncarew @hixie
* Refactor the Gesturer's interfaces
This makes them more coherent.
It also makes it easier for the tests to override each specific part of
hit-testing, should that be necessary.
* Update binding.dart
Only partially works. Editing the selected text doesn't work very well,
which probably will require engine changes. Currently only draws the
selected text and allows you to manipulate the selection with draggable
selection handles.
Prior to this patch, we were pushing two frames each time the cursor blinked.
In turning the cursor on or off, the markNeedsPaint call was triggering another
frame to be scheduled because we cleared a bit in the scheduler at the
beginning of the frame instead of at the end of the frame.
To implement scheduling correctly, we actually need two bits: one for
ensureVisualUpdate, which just promises to get to the end of the pipeline soon,
and scheduleFrame, which promises to get to the beginning of the pipeline soon.
Also a bit of code cleanup.
The key part of this patch is the addition in `_endScroll` to reset
`_simulation`. It seems like this was the one place where it's possible
for us to end the animation but not reset our state. Since we assert
that are state is coherent, we were hitting asserts when a fling
finished and then you interacted with the widget again.
The 'routes' table is a point of confusion with new developers. By
providing a 'home' argument that sets the '/' route, we can delay the
point at which we teach developers about 'routes' until the point where
they want to have a second route.
This makes it easier to use e.g. AssetImage in simple test applications.
Also, dartdoc improvements.
Also, use @required in one place, to see if it causes any trouble. If it
doesn't, I'll start using it in more places.