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.
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
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.
- `Scaffold.of(context).showBottomSheet(widget);`
- Returns an object with .closed Future and .close() method.
- Uses a StateRoute to handle back button.
- Take the Navigator logic out of the BottomSheet widget.
- Support showing a sheet while an old one is going away.
- Add Navigator.remove().
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.
"showSnackBar()" is now a feature of a Scaffold. To get to a Scaffold
you either use a global key (`scaffoldKey.currentState.showSnackBar(...)`),
or you use `Scaffold.of(context)`.
Snack bars no longer have a route. They are entirely managed by the
Scaffold. Fixes#432.
Snack bars now queue up when you have several of them. Fixes#374.
Snack bars now auto-size themselves around their contents. This is step
one towards implementing multiline snack bars.
Snack bars now self-dismiss after some per-snackbar configurable period.
The self-dismissing pauses while a dialog is up above the snackbar (or
anything that uses ModalRoute). To enable this, there's now a
`ModalRoute.of(context)` API that returns the current ModalRoute, and
you will be rebuilt if you asked for this and the route's "current"
status changes. To implement this, the Navigator now rebuilds
unconditionally any time it pushes or pops a route.
Snack bars now use the curves that Android uses for snack bars.
Snack bar contents now fade in.
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.
Factored OverlayRoute out of the modal and persistent bottom sheet clases, since the bottom sheet classes need to drive the performance.
Added a bottom sheet to the stocks demo: long-press on a stock shows a modal bottom sheet.
Made AnimatedModalBarrier public.
It's common to want a scrolling viewport but with padding around the
contents. Teaching Block about this makes the places that do this
substantially simpler and further buries ScrollableViewport and
BlockBody (they're now only used in scrollable.dart).
This patch introduces the notion of a ModalRoute that puts up a modal barrier
and makes the route invisible to hit testing when its animating out. This patch
also uses this mechanism in a number of places (including PageRoute). There are
still a few more cases to convert, but that's work for a future patch.
Fixes#1684
Material design icons are defined to work at specific sizes: 18, 24, 36, 48.
The current API doesn't reflect that and just takes a size int. If an invalid
size is chosen an error is printed to the console and no icon shows up.
Fixes#1816
- Change RouteArguments to pass the route's BuildContext rather than
the Navigator. This caused the bulk of the examples/ and .../test/
changes (those are mostly mechanical changes). It also meant I could
simplify Navigator.of().
- Make initState() actually get called when the State's Element is in
the tree, so you can use Foo.of() functions there. Added a test for
this also.
- Provide a RouteWidget so that routes have a position in the Widget
tree. The bulk of the route logic is still in a longer-lived Route
object for now.
- Make Route.setState() only rebuild the actual route, not the whole
navigator.
- Provided a Route.of().
- Provided a Route.writeState / Route.readState API that tries to
identify the clients by their runtimeType, their key, and their
ancestors keys, up to the nearest ancestor with a GlobalKey.
- Made scrollables hook into this API to track state. Added a test to
make sure this works.
- Fix the debug output of GestureDetector and the hashCode of
MixedViewport.
- Fixed ScrollableWidgetListState<T> to handle infinite lists.
Instread of an explicit 'enabled' bool, this uses the presence of the
event handler to determine if a widget is enabled or not. This means
that if you've not passed a handler, your widget will be disabled, which
makes sense, since it wouldn't work anyway.
Adds this feature to checkbox, and ports raised button, flat button, and
radio buttons to this new model.
Adds a checkbox to card_collection that can be disabled.
Hide a (basically bogus) hint from the (soon to be disabled) strong hint
mode in the analyzer that this reveals.
If you load the example and immediately switch to the Portfolio tab, you may
see exceptions due to symbols that are in the portfolio list but whose
data is not yet present in the stocks map
Make Radio widgets take a type that describes the type of their value,
so that you can catch when you use the wrong value.
Standardise on ValueChanged<Foo> instead of having a FooValueChanged
for every value of Foo.