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

Side by Side Diff: sky/examples/stocks2/lib/stock_app.dart

Issue 1189113004: fix back button in stocks app by calling super.didMount() (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'package:sky/rendering/sky_binding.dart'; 5 import 'package:sky/rendering/sky_binding.dart';
6 import 'package:sky/widgets/basic.dart'; 6 import 'package:sky/widgets/basic.dart';
7 import 'package:sky/widgets/navigator.dart'; 7 import 'package:sky/widgets/navigator.dart';
8 import 'package:sky/widgets/widget.dart'; 8 import 'package:sky/widgets/widget.dart';
9 9
10 import 'stock_data.dart'; 10 import 'stock_data.dart';
11 import 'stock_home.dart'; 11 import 'stock_home.dart';
12 import 'stock_settings.dart'; 12 import 'stock_settings.dart';
13 13
14 class StocksApp extends App { 14 class StocksApp extends App {
15 15
16 StocksApp() { 16 StocksApp() {
17 _navigationState = new NavigationState([ 17 _navigationState = new NavigationState([
18 new Route( 18 new Route(
19 name: '/', 19 name: '/',
20 builder: (navigator, route) => new StockHome(navigator, route, _stocks) 20 builder: (navigator, route) => new StockHome(navigator, route, _stocks)
21 ), 21 ),
22 new Route( 22 new Route(
23 name: '/settings', 23 name: '/settings',
24 builder: (navigator, route) => new StockSettings(navigator) 24 builder: (navigator, route) => new StockSettings(navigator)
25 ), 25 ),
26 ]); 26 ]);
27 } 27 }
28 28
29 void didMount() { 29 void didMount() {
30 super.didMount();
30 new StockDataFetcher((StockData data) { 31 new StockDataFetcher((StockData data) {
31 setState(() { 32 setState(() {
32 data.appendTo(_stocks); 33 data.appendTo(_stocks);
33 }); 34 });
34 }); 35 });
35 } 36 }
36 37
37 final List<Stock> _stocks = []; 38 final List<Stock> _stocks = [];
38 NavigationState _navigationState; 39 NavigationState _navigationState;
39 40
(...skipping 10 matching lines...) Expand all
50 } 51 }
51 52
52 void main() { 53 void main() {
53 print("starting stocks app!"); 54 print("starting stocks app!");
54 runApp(new StocksApp()); 55 runApp(new StocksApp());
55 SkyBinding.instance.onFrame = () { 56 SkyBinding.instance.onFrame = () {
56 // uncomment this for debugging: 57 // uncomment this for debugging:
57 // SkyBinding.instance.debugDumpRenderTree(); 58 // SkyBinding.instance.debugDumpRenderTree();
58 }; 59 };
59 } 60 }
OLDNEW
« 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