Revised PageableList et al
An itemExtent-computing SizeObserver is no longer needed to use PageableList. The PageableList just uses its own size as the itemExtent.
Added the itemsSnapAlignment property to PageableList which enables snapping scrolls to an adjacent item (the default), or any item boundary no not at all.
PageableList scrollOffsets now vary from 0.0 to itemCount instead of 0.0 to itemExtent * itemCount. Using logical coordinates instead of pixel coordinates means that the scroll position is insensitive to changes in the PageablList's size.
Added HomogenousPageViewport which is used by PageableList. HomogenousPageViewport scrollOffsets are defined as for PageableList.
Factored the (substantial) common parts of HomogenousViewport HomogenousPageViewport into a file private _ViewportBase class.
Removed PageableWidgetList. PageableList now just extends Scrollable. Moved PageableList into its own file.
Removed the pixel dependencies from ScrollBehavior. ScrollBehavior.createFlingSimulation() no longer sets the simulation's tolerance. The caller must do this instead.
Scrollable now uses pixelToScrollOffset() to convert from input gesture positions and velocities to scrollOffsets.
Fixes#710
- Remove unused FocusChanged typedef.
- Remove unused centerOfAttentionHeroTag.
- Modernize static functions for interacting with Scrollable by moving them
into the Scrollable class.
We had the units wrong on the tolerances. Previously we multiplied by the
device pixel ratio, which meant we got larger tolerances as we got more
resolution. Also, simplify logic in Newton for applying the tolerances.
Fixes#828
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.
I had to add a setLocale method to WidgetTester and
split the code in FlutterBinding which handled locale
changes to allow me to dispatch a locale change w/o actually
changing what the c++ code reports as the locale.
Also added the test to Travis.
@abarth @jason-simmons
After this patch, if you try to use a widget that depends on being enclosed in
a material, you now get an assert and a debugPrint if you're not inside a
material.
Fixes#243
Previously we tried to work around some possible badness from the engine
side, but now we are more assertive about the engine needing to do the
right thing.
Factor out a reusable interface called Decoration from BoxDecoration.
Make all the consumers of BoxDecoration and the erstwhile BoxPainter
into consumers of Decoration.
Make a BoxPainter be something you get from a Decoration, rather than
something to which you pass a BoxDecoration.
Rename Shape to BoxShape now that it's documented specifically as
applying to boxes.
Move EdgeDims to its own file.
Move FractionalOffset up so that it's with the other helper classes in
its file rather than alone at the end.
Minor change to RenderClipOval's hit testing to avoid taking an
unnecessary square root.
Rename BoxDecorationPosition to DecorationPosition since
RenderDecoratedBox now takes any Decoration.
Implement hit testing for rounded rects.
Rename AnimatedBoxDecorationValue to AnimatedDecorationValue, and make
it support lerping across any Decoration (by deferring to the objects
involved).