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

Unified Diff: sky/sdk/example/stocks/lib/stock_home.dart

Issue 1209423006: Fix back button behavior when returning from settings screen (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/example/stocks/lib/stock_home.dart
diff --git a/sky/sdk/example/stocks/lib/stock_home.dart b/sky/sdk/example/stocks/lib/stock_home.dart
index 7adb18f314a383d8aecb2d861aa9ee5437fcefbb..64de6f0c77961ef663432799d28044972e0589b5 100644
--- a/sky/sdk/example/stocks/lib/stock_home.dart
+++ b/sky/sdk/example/stocks/lib/stock_home.dart
@@ -149,7 +149,7 @@ class StockHome extends StatefulComponent {
new MenuDivider(),
new MenuItem(
icon: 'action/settings',
- onPressed: () => navigator.pushNamed('/settings'),
+ onPressed: _handleShowSettings,
children: [new Text('Settings')]),
new MenuItem(
icon: 'action/help',
@@ -158,6 +158,13 @@ class StockHome extends StatefulComponent {
);
}
+ void _handleShowSettings() {
+ assert(navigator.currentRoute.name == '/drawer');
+ navigator.pop();
+ assert(navigator.currentRoute.name == '/');
+ navigator.pushNamed('/settings');
+ }
+
void _handleOpenDrawer() {
_drawerController.open();
navigator.pushState("/drawer", (_) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698