Also, clean up the class hierarchy for AnimationController now that
we've renamed progress to value. That means everything in the hierarchy
now has a value, include Watchable. This patch renames Watchable to
Animated<T>, which lets us use that type almost everywhere.
I've added some ducktape to modal bottom sheets to avoid having to
refactor all of Navigator to use AnimationController. I'll remove the
ducktape in the next patch.
This patch removes state from the animation system, which was causing problems
as we were scaling the use of animated values.
Now the "tween" objects are stateless and can watch animations, which creates a
new object that holds both the tween and the animation instead of mutating the
tween every tick of the animation.
This patch ports one client as a proof-of-concept.
Fixes#215
Turns out Android crashes if the colour is not opaque, so we enforce
that at the Dart level.
Also, since label and colour are both actually optional, make them
named arguments.
Introduces a new Tooltip class.
Adds support for tooltips to IconButton and Scaffold.
Adds some tooltips to various demos.
Also some tweaks to stack.dart that I made before I decided not to go
down a "CustomPositioned" route.
The Firebase server seems to have changed behavior and is not giving us a List
instead of a Map. This patch switches us back to GitHub, which just serves the
same flat files all the time.
If you change the RenderObject tree between frames, you'll assert if
you subsequently hit test. So e.g. if you get two button presses back
to back, and you mutate the tree synchronously in response to the
first one, the second will assert.
This adds an onBuild callback to WidgetToRenderBoxAdapter to make it
easier to do the updates at the right time, i.e., during widget build.
It'll be called whenever you rebuild the WidgetToRenderBoxAdapter
itself, so all you have to do to use it is call setState() on whoever
is building the WidgetToRenderBoxAdapter.
- Add an option to enable debugPaintSizeEnabled.
- Add an option to enable the StatisticsOverlay.
- Add support for the StatisticsOverlay in MaterialApp.
- Change the layout behaviour of RenderStatisticsBox:
- Give it a zero intrinsic width.
- Give it an accurate intrinsic height that depends on the flags
set. (Also, move the enum to the rendering/ layer from the
widgets/ layer to enable this.)
- Make the box automatically size itself full-width and the correct
height, so that you can actually embed it (though most of the
time you'd just put it in a Stack so this doesn't matter as
much, really).
- Some style nit fixes in statistics_box.dart.
This patch also changed ScrollableList2 to use an Iterable instead of an
List for its children. This change lets clients map their underlying
data lazily. If the clients actually have a concrete list, we skip the
extra copy and grab the child list directly.
ScrollableList2 uses the same pattern as ScrollableGrid, which requires the
client to allocate widgets for every list item but doesn't inflate them unless
they're actually needed for the view. It improves on the original
ScrollableList by not requiring a rebuild of the whole visible portion of the
list when scrolling. In fact, small scrolls can often be handled entirely by
repainting.
We now support (vertically) scrollable grids with viewporting. If the
scroll doesn't reveal any new rows, we execute the scroll with a repaint
(i.e., no layout). If the scroll reveals a new row, we trigger a layout
to change the set of materialized children in the viewport.
This patch make grid layout much more flexible. The behavior is factored
out into a GridDelegate that's modeled after the custom layout
delegates. The patch includes a MaxTileWidthGridDelegate that implements
the old behavior and a FixedColumnCountGridDelegate that implements a
grid layout with a fixed number of columns.
Fixes#1048
The TabBarSelection change animation needs to start where the fling's drag gesture ended rather than from zero. The intial vlaue of progress for the TabBarSelection's performance is now converted from the range used during an interactive drag, to the range used when animating from the previously selected tab to the new one.
TabBarSelection now requires a maxIndex parameter.
This matches the naming pattern expected from package:test
`flutter test` doesn't care, since it finds all _test.dart
files and runs them regardless of directory.
@Hixie
- Remove unused FocusChanged typedef.
- Remove unused centerOfAttentionHeroTag.
- Modernize static functions for interacting with Scrollable by moving them
into the Scrollable class.
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
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).
Users of MaterialApp can provide an onLocaleChanged handler that will be
called to asynchronously fetch locale-specific data. MaterialApp will
then instantiate a LocaleQuery that supplies the locale data to its
descendants.
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.
Also:
- minor code reindents in places.
- reset the widget tree between tests.
- once you generate a route, don't let its builder change
(previously it would keep changing as the routes table changed).
- revert the stocks app toolbar-fading-on-forward-transition thing.
This patch restructures how we handle drawer. The drawer is now a child of the
Scaffold, which wraps the Drawer in a DrawerController. The DrawerController
manages the interaction with the navigator as well as the edge swiping. The
DrawerController's state machine is driven almost entirely off its Performance,
which it now owns completely.
Fixes#90Fixes#187Fixes#192Fixes#194Fixes#604
This patch integrates Mimicable with Overlay such that you can tell a Mimicable
to lift up into the overlay and animate towards another widget identified by a
global key.
Heroes with the same tag have to have keys that are unique across the
entire subtree. Since we can now show both stock lists, this means we
have to include the tab in the heroes' keys.
Fixes#668.
The TabBar's selection is now represented by a TabBarSelection object which encapsulates both the previous and currently selected indices and the Performance used to animate the selection indicator.
Added a TabBarView class which displays a tab's contents. It uses a shared TabBarSelection to stay in sync with a TabBar. The TabBarView scrolls in sync with the TabBar when the selection changes. Eventually it will allow one to fling the selection forward or backwards.
Added a tabBar property to ToolBar. Typically the corresponding TabBarView will be the body of the toolbar's Scaffold.
Removed TabNavigatorView and TabNavigator.
Added a widget gallery tabs demo page. Removed the old tabs demo.
- These controls now have proper radial reactions.
- You can drag the switch.
- The radio button animates properly.
- There's a demo in the Material Gallery