These widgets were designed in CSS where you need to specify a layout model for
your children. This patch updates them to the modern style of just taking a
unique child.
Fixes#755
- Introduce _setScrollOffset as a backend for the animations so that scrollTo
can stop animations.
- Create a single function that stops both kinds of scroll animations.
- Refactor how we update the bounds for bounded scroll behaviors so that we
update the bounds and compute the new scroll offset at the same time.
Also refactors ios_sim.py to be part of sky_tool.
The current skyx file that ‘listen’ generates does not contain material design icons, so icons will be missing.
This patch adds a new test harness and a first, trivial test to run with the
harness. The new test harness is built on package:test and should run on
Travis. Over time, we'll migrate our existing tests into this harness.
This also changes the way we insert nodes into a
MultiChildRenderObjectWrapper's renderObject, which fixes issue #626.
Now, instead of the slot being a renderObject, it's the Widget that
currently uses that renderObject. That way when the Widget changes
which renderObject to use, the siblings of that Widget in the same
child list don't have to be notified of the change.
I tested performance of the new algorithm vs the old algorithm using
the stocks demo at idle and the stocks demo scrolling steadily. The
data suggests the algorithms are roughly equivalent in performance.
Workaround for Drawer.initState() fails
This is a hack to avoid #715
In theory, the navigator's state should be updated in the event handler that triggers opening the drawer. It's not obvious how to do this, since we only build the Drawer when it's supposed to be visible (and once we're building it's too late).
When laying out positioned children inside a stack, we should give them
unbounded constraints because if they draw outside of the stack, we'll just
clip them.
- Introduce some new Layer classes.
- Introduce paintChildWith* methods.
- Convert paint() methods to use paintChildWith* where appropriate.
- Fix paintBounds logic in Layer world.
- Introduce Layer.replaceWith(), so that it's clearer what's going on.
- Make RenderObjects have a ContainerLayer, not a PictureLayer.
- Introduce a PaintingContext.replacingLayer() constructor to highlight
where we are creating a layer just to replace an older one.
- Rename some layer-related methods and fields for clarity:
requiresCompositing -> hasLayer
hasCompositedDescendant -> needsCompositing
updateCompositing -> updateCompositingBits
_needsCompositingUpdate -> _needsCompositingBitsUpdate
markNeedsCompositingUpdate -> markNeedsCompositingBitsUpdate
- After updating compositing bits, if we find that the bit changed, we
now call markNeedsPaint().
- Reorder markNeedsPaint() logic for clarity.
- Make flushPaint() start at the deepest node.
- Make _compositeChild() avoid repainting children with hasLayer that
aren't dirty, instead it just reuses their existing layer.
- Made RenderView reuse the RenderObject layer instead of having its own.
- Made RenderView have hasLayer set to true.
- Add various asserts and comments.
Changed the pageable_list.dart example: tapping on the toolbar changes
the scroll direction. This exposed some problems:
- Scrollable.syncFields() didn't update scrollDirection
- Viewport updated its RenderObject fields in the wrong order
- FixedHeightScrollable scrollDirection changes didn't update the scrollBehavior
There may be similar problems with VariableHeightList and ScrollableViewport.
I will fix those in a separate CL.
Rather than using a Padding widget to provide padding along the scrolling axis,
we now just figure the padding into where we draw the items. This patch fixes
an issue where we would remove the first topmost item in a scrollable list too
early because we thought it was already off screen.
Fixes#697
- Clarify comment about RenderObjectWrapper.
- Assert that we never sync a RenderObjectWrapper with an instance of a different type.
- Assert that MultiChildRenderObjectWrapper subclasses always have multi-child RenderObjects.
- Assert that renderObject doesn't change identity when syncing.
- Make searchForOldNode() return void since the return value is ignored.
- Remove code that handled renderObject changing during sync.