If it's a StatefulComponent, then it's ok to reuse it so long as it
hasn't been initialised.
If it's a regular Component or a TagNode, then it's always ok to reuse.
If it's a RenderObjectWrapper, then it's ok to reuse so long as it
doesn't have a renderObject.
To put it another way, this changes how we prevent the following
nonsensical situations from arising:
- Sync two stateful StatefulComponents together
- Sync two RenderObjectWrappers with RenderObjects together
When either of those cases happen, we just drop the old one on the
ground and use the new one unchanged.
Dismissable now only depends on GestureDetector.
Added a unit test that verifies that issue #1068 has been fixed. It's commented out for now.
Cleaned up VelocityTracker.cc et al a little.
That way the fling engages in the same direction as the scroll. For example, if
you have a horizontal scroll nested inside a vertical scroll, the fling will
take place in the same direction as the scroll.
Previously, if you used a number of nested Blocks, they'd each try to register
drag gesture detectors even though they can't actually scroll. This CL teaches
Scrollable to watch for drag gestures only when it can actually scroll.
Allows a non-initialised stateful component to be used as a source of
settings more than once. Instead of asserting that it was only being
used once, we assert that once you are stateful you don't get used as a
bag of settings, which is the real thing we were trying to avoid.
A lot of code ends up using StatefulComponents as a source multiple
times in a row, and before this would fail.
Patch by Ian Hickson
Added FlingGestureRecognizer and exposed it in the GestureDetector class. FlingGestureRecognizer is based on the Android/Chromium VelocityTracker class which computes a velocity vector for for a list of X,Y,Time tuples.
The Scrollable classes now use the FlingGestureRecognizer. Dismissable and Drawer still need to be updated
This was a typo in #1062.
Also, some minor code cleanup and expose (in the app dump) the
_disqualifiedFromEverAppearingAgain boolean for debugging purposes.
Move the animation libraries into src/animation and change importers to use
package:sky/animation.dart. Also, move scheduler.dart into the animation
library so that the animation library can be self-contained.
This makes the sync code stop if it would have to rearrange the
RenderObjects. I'll make it handle the cross-RenderObject case, as well
as the insertion-sync case, in subsequent patches.
Turns out many of the functions on BoxConstraints weren't used or had callers
that could easily be updated to other functions. I've added dartdoc to all the
public functions as well as renamed some functions that had similar names but
did different things.
This patch makes Center and Align expand by default, which is usually what you
want. It also adds a ShrinkWrap option to let you shrink wrap in one or both
directions if that's really what you want to do.