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.
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
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.
Alternating scroll gestures would sometimes be ignored because _ScrollGestureRecognizer didn't always reset its _state when the pointer[s] went up.
A Dismissable dismiss triggered by a drag and then a fling could cause the next attempt to drag-dimiss to fail.
Fixed the definition of lerpColor().
This should handle a case like a stateful component inside a Container
inside another Container having one of those Containers removed while
still keeping that stateful component around with its state.
The problem of how to handle the Container then being reinserted is a
separate issue not handled by this patch.
Convert Dismissable to use gestures
Convert Dismissable to use the ScrollStart, ScrollUpdate, and ScrollEnd gestures. Support for fling gestures is TBD.
Included a basic unit test that checks that one item can be dismissed with a press-drag-release gesture.
Fixed the scroll gesture recognizer: if the last pointer goes up and candidate recognizers still exist, then reject the gesture.
Convert Dismissable to use the ScrollStart, ScrollUpdate, and ScrollEnd gestures. Support for fling gestures is TBD.
Included a basic unit test that checks that one item can be dismissed with a press-drag-release gesture.
Fixed the scroll gesture recognizer: if the last pointer goes up and candidate recognizers still exist, then reject the gesture.
This patch makes ParentDataNode less general purpose and instead teaches Flex
and Stack how to program the parent data for their children. We used to have
this general system because parent data used to carry CSS styling, but we don't
need it anymore.
Fixes#957
Adds a HomogeneousViewport class that works like MixedViewport but
handles only children that have all the same height.
Converts ScrollableWidgetList to use that, so that we don't waste a
frame looking at the size of the contents each time we change size.
This allows a number of seemingly pointless double-pumps in the tests
to be removed.
Other changes that were necessary to support the above:
- RenderBlock now supports minExtent (think 'min-height' in CSS)
- RenderBlock now supports itemExtent (forces the height of each
child to be the same, so that the itemExtent passed to the fixed-
height scrollables are all authoritative instead of a source of
bugs when they don't match)
- RenderBlockViewport now supports horizontal scrolling
- improved the style of the isInfinite assert in box.dart
- fixed the position of a comment in mixed_viewport.dart
- added a test
- made the logic for how many items to show be more precise
If there are no other gestures in the arena, we should kick off the scroll
gesture right away. This change pulled a refactoring of how we dispatch events
to Widgets. Now we dispatch events to Widgets interleaved with their associated
RenderObjects. (Previously we dispatched to all of the RenderObjects first.)
Add a way of having keys based on numeric types or DateTimes by having a ValueKey<T> class.
Remove the redundant ways of declaring things, except for leaving one shorthand -- you can say `new Key(s)` instead of `new ValueKey<String>(s)`.