Commit 99e115d0 authored by Adam Barth's avatar Adam Barth

Settings menu item in stock2 doesn't work

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.
parent 2460ce37
...@@ -23,7 +23,7 @@ void main() { ...@@ -23,7 +23,7 @@ void main() {
void allLoaded(ImageMap loader) { void allLoaded(ImageMap loader) {
_loader = loader; _loader = loader;
new GameDemoApp(); runApp(new GameDemoApp());
} }
class GameDemoApp extends App { class GameDemoApp extends App {
......
...@@ -12,8 +12,6 @@ import 'stock_settings.dart'; ...@@ -12,8 +12,6 @@ import 'stock_settings.dart';
class StocksApp extends App { class StocksApp extends App {
StocksApp({ RenderView renderViewOverride }) : super(renderViewOverride: renderViewOverride);
NavigationState _navState = new NavigationState([ NavigationState _navState = new NavigationState([
new Route(name: '/', builder: (navigator) => new StockHome(navigator)), new Route(name: '/', builder: (navigator) => new StockHome(navigator)),
new Route(name: '/settings', builder: (navigator) => new StockSettings(navigator)), new Route(name: '/settings', builder: (navigator) => new StockSettings(navigator)),
...@@ -37,7 +35,7 @@ class StocksApp extends App { ...@@ -37,7 +35,7 @@ class StocksApp extends App {
void main() { void main() {
print("starting stocks app!"); print("starting stocks app!");
App app = new StocksApp(); runApp(new StocksApp());
WidgetAppView.appView.onFrame = () { WidgetAppView.appView.onFrame = () {
// uncomment this for debugging: // uncomment this for debugging:
// WidgetAppView.appView.debugDumpRenderTree(); // WidgetAppView.appView.debugDumpRenderTree();
......
...@@ -51,5 +51,5 @@ class ContainerApp extends App { ...@@ -51,5 +51,5 @@ class ContainerApp extends App {
} }
void main() { void main() {
new ContainerApp(); runApp(new ContainerApp());
} }
...@@ -11,5 +11,5 @@ class HelloWorldApp extends App { ...@@ -11,5 +11,5 @@ class HelloWorldApp extends App {
} }
void main() { void main() {
new HelloWorldApp(); runApp(new HelloWorldApp());
} }
...@@ -73,5 +73,5 @@ class NavigationExampleApp extends App { ...@@ -73,5 +73,5 @@ class NavigationExampleApp extends App {
} }
void main() { void main() {
App app = new NavigationExampleApp(); runApp(new NavigationExampleApp());
} }
...@@ -137,7 +137,7 @@ class SectorApp extends App { ...@@ -137,7 +137,7 @@ class SectorApp extends App {
} }
void main() { void main() {
App app = new SectorApp(); runApp(new SectorApp());
WidgetAppView.appView.onFrame = () { WidgetAppView.appView.onFrame = () {
// uncomment this for debugging: // uncomment this for debugging:
// WidgetAppView.appView.debugDumpRenderTree(); // WidgetAppView.appView.debugDumpRenderTree();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment