This patch teaches the widget framework how to use Cassowary-based
autolayout. To integrate autolayout with widgets, I had to refactor how
RenderAutoLayout worked a bit. Now RenderAutoLayout follows the same
delegate pattern we use for custom paint and custom layout.
This patch improves the checkbox animation as suggested by the design
team. The color transition now occurs earlier in the animation and there
are fewer components to the animation.
Fixes#1614
Fixes https://github.com/flutter/flutter/issues/1331
Hopefully this will be enough to start with. If this continues to be a
point of confusion we can see about adding more documentation or
changing the API somehow.
We were using an Offset, which represented pixels/second, but it wasn't
clear to clients whether that was pixels/ms. Now we use a Velocity class
that is explict about the units.
Fixes#1510Fixes#785
Drawer doesn't need a SizeObserver, since it only looks at the size
in event handlers. It can just go and probe the tree to read the size.
Also, change from using _kEdgeDragWidth to using _kWidth when figuring
out how much of the drawer to show when dragging it from the edge, since
that is more likely to match the drawer's width.
Remove the SizeObserver you need to use snap alignment in lists by
having the lists provide the size themselves in the callback.
Also, remove snapAlignmentOffset since we couldn't figure out how to
explain it and it's not really needed.
Move StepTween to tween.dart.
Move _buildIndicator() methods to be next to the build() methods they're
used from, so that reading the code is easier.
Fix typos, add some comments, style nits.
We expose `imageCache`, which is an ImageCache, but previously the class
was private which means there was no documentation for the methods on
that object.
Fixes#1750
This patch tightens up the imports in this file and hides some more of
the implementation details by making RepeatingCurveTween and StepTween
private.
Also, removed a CurvedAnimation with a linear curve. That's not needed
because the animation controller itself is an Animation<double>.
This animation expands/collapses an arc that's 3/4ths of a circle.
The next iteration begins where the previous appeared to finish.
This happens while the whole thing rotates, such that the starting point of each
expansion moves in a star-wise pattern around the circle.
See:
https://www.google.com/design/spec/components/progress-activity.html
(note: the video here demonstrating this animation is actually slightly incorrect...
we'll hopefully update it soon)
This lets it cooperate with other gestures like tap.
The way I implemented this was to refactor the entire Draggable gesture
logic to use a new kind of gesture detector called
MultiDragGestureRecognizer. It works a bit like
MultiTapGestureRecognizer but for drags.
Also some tweaks to the velocity estimator.
Each layer is supposed to reexport the parts of the previous layer
that are part of its API.
- In painting.dart, export from dart:ui all the Canvas-related APIs
that make sense to be used at higher levels, e.g. PaintingStyle.
- Delete painting/shadows.dart. It was dead code.
- In rendering/object.dart, export all of painting.dart.
- In widgets/basic.dart, export all of painting.dart and
animation.dart. Some classes in animation/ are renamed to make this
less disruptive and confusing to the namespace.
- Split out Stocks back into an import model rather than a part model,
so that it's easier to manage its dependencies on a per-file basis.
- Move Ticker to scheduler library.
- Remove as many redundant imports as possible now.
- Some minor nit picking cleanup in various files.
The asserting will continue until morale improves!
* Convert all assert(*.isNormalized) checks to use the new
debugAssertIsNormalized technology.
* Convert CustomMultiChildLayout to use the new RenderingError
technology to greatly improve the detail in errors you get when
writing CustomMultiChildLayout delegates.
* Add BoxConstraints.copyWith().
* Indent the descendants in the rendering exception data dump so that
when you have multiple children it's clearer what's going on.
Negative constraints never make sense, so catch those too.
Make RenderObject.layout's isNormalized assert use the newer more fancy
debug version of isNormalized.