Add BoxConstraints.isNormalized feature.
Use this feature in asserts in all the intrinsic dimension methods, in
various relevant BoxConstraints methods, and in layout().
Wrap the _DebugSize logic in BoxConstraints.constrain() in an assert
block to avoid a branch in release mode.
Remove the logic in BoxConstraints.isSatisfiedBy() that dealt with
non-normalized values.
Add BoxConstraints.normalize().
Make RenderCustomOneChildLayoutBox.performLayout() only set
parentUsesSize on the child if the constraints aren't tight.
Instead of PointerInputEvent having a "type" field, we now have a
different class for each pointer type.
This has ripple effects throughout the system.
I also did code cleanup in affected files while I was there.
Many of the widgets that use CustomPaint were spamming repaints because
CustomPaint repaints when the identity of the onPaint callback changes, which
it does every build for StatelessComponents.
This patch changes CustomPaint to use a CustomPainter, similar to the new
custom layout widgets. The CustomPainter has a `shouldRepaint` function along
with its `paint` function. This function gives clients explicit control over
when the custom paint object repaints.
This patch simplifies PaintingContext with several goals:
1) We now call a callback instead of assuming the caller has a single child to
paint. This change will let us handle render objects that wish to paint more
than one child.
2) We now avoid creating lots of empty picture layers because we don't eagerly
start recording pictures. Instead, we wait for the first caller to touch the
canvas before creating the picture recorder.
3) We now are more consistent about which values have incorporated the painting
offset.
Shadows now render as three seprate MaskFilter.blur components per the most recent Material spec.
The shadows Map was replaced by a similar Map called elevationToShadow with entries that match the 10 elevations specifed by http://www.google.com/design/spec/what-is-material/elevation-shadows.html.
The "level" property (many classes) is now called "elevation", to match the Material spec.
BoxShadow now includes a spreadRadius parameter - as in CSS box-shadow. Renamed the BoxShadow blur property to blurRadius to further align BoxShadow with CSS box-shadow.
Also, fix warnings in rendering/sector_layout.dart
Also, fix hit testing in rendering/sector_layout.dart
Also, add WidgetToRenderBoxAdapter
Also, make the rendering library debugging tools more resilient to
dumping stuff before layout is complete.
Also, introduce Colors and Typography to hold the material colors and the
typography declarations. Previously we expected clients of these libraries to
import them into a namespace, but that doesn't play nice with re-exporting them
from material.dart.
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.
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 still leaves Flex and FlexDirection available. At some point once
people have transitioned to Row/Column we should rename Flex to _Flex
and stop reexporting FlexDirection from basic.dart.
Similar to widgets.dart, rendering.dart exports the entire rendering layer.
Also, update the examples to use rendering.dart and widgets.dart. Also clean up
some exports so that the examples have more sensible imports.
Sadly, box.dart has grown much longer than 1000 lines. This patch splits it up
into several files based on the class hierarchy. Fortunately, many of these
classes are loosely coupled to each other.
We had a remarkable number of analyzer failures.
I'll fix the bots to analyze across the whole project
in a follow-up patch, that should prevent this
in the future.
@abarth