Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: sky/sdk/lib/widgets/widget.dart

Issue 1195493002: Refactor Navigator to put state in separate class, initial back button plumbing (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: abarth CR feedback Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« sky/sdk/lib/app/view.dart ('K') | « sky/sdk/lib/widgets/navigator.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/widget.dart
diff --git a/sky/sdk/lib/widgets/widget.dart b/sky/sdk/lib/widgets/widget.dart
index 7d450c98b11bdc330f7d7a1c48fb41004364fb4f..fcf6ebbceec18cfd02d9e82638ae873f67e9cc26 100644
--- a/sky/sdk/lib/widgets/widget.dart
+++ b/sky/sdk/lib/widgets/widget.dart
@@ -799,10 +799,17 @@ abstract class App extends AbstractWidgetRoot {
if (root.parent == null) {
// we haven't attached it yet
WidgetAppView._appView.root = root;
+ WidgetAppView._appView.eventListeners.add((event) {
Hixie 2015/06/17 19:29:43 This shouldn't use the underbar version. If there'
+ if (event.type == "back")
+ onBack();
+ });
}
assert(root.parent is RenderView);
}
+ // Override this to handle back button behavior in your app
+ void onBack() { }
+
}
typedef Widget Builder();
« sky/sdk/lib/app/view.dart ('K') | « sky/sdk/lib/widgets/navigator.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698