- 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.
(These are changes cherry-picked from in-flight branches since they are
more independent and could be helpful even without those changes.)
- Change RouteBuilder's signature to take a single argument in which the
other fields are placed, so that we can keep iterating on those
arguments without having to break compatibility each time. Also, this
makes defining route builders much simpler (only one argument to
ignore rather than a variable number).
- Expose the next performance to RouteBuilders, since sometimes the
route itself might not be where it's used.
- Allow BuildContext to be used to walk children, just like it can for
ancestors
- Allow BuildContext to be used to get the Widget of the current
BuildContext
- Allow StatefulComponentElement to be referenced with a type
specialisation so that you don't have to cast when you know what the
type you're dealing with actually is.
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.
Currently you lose your scroll and drawer state when coming back from the settings pane.
I think we should solve this by having the Navigator maintain a Stack and
keeping the StockHome alive underneath it. But this is good enough for a first iteration.
R=abarth@chromium.org, abarth
Review URL: https://codereview.chromium.org/1191153002.
The underlying problem is that we lacked a RenderObjectWrapper for the
RenderView, which meant we couldn't handle changing the RenderObject that was
the root of the RenderView. This CL introduces a RenderViewWrapper and uses it
in a new AppContainer widget root. This change allows us to make App a
non-magical Component that is inserted into the AppContainer in the newly
introduced runApp function.
R=ianh@google.com
Review URL: https://codereview.chromium.org/1184823006.