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

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

Issue 1213623008: Back button should be able to close apps (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 | sky/sdk/lib/widgets/widget.dart » ('j') | sky/sdk/lib/widgets/widget.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/example/stocks/lib/main.dart
diff --git a/sky/sdk/example/stocks/lib/main.dart b/sky/sdk/example/stocks/lib/main.dart
index 6050cf5e580e050c8f8fe9ba5bd2af487e68a336..2120913d3710226a130d5374bccad3fb7316ee7a 100644
--- a/sky/sdk/example/stocks/lib/main.dart
+++ b/sky/sdk/example/stocks/lib/main.dart
@@ -32,10 +32,13 @@ class StocksApp extends App {
}
void onBack() {
- setState(() {
- _navigationState.pop();
- });
- // TODO(jackson): Need a way to invoke default back behavior here
+ if (_navigationState.hasPrevious()) {
+ setState(() {
+ _navigationState.pop();
+ });
+ } else {
+ super.onBack();
+ }
}
StockMode optimismSetting = StockMode.optimistic;
« no previous file with comments | « no previous file | sky/sdk/lib/widgets/widget.dart » ('j') | sky/sdk/lib/widgets/widget.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698