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

Side by Side Diff: sky/sdk/example/stocks/lib/main.dart

Issue 1233703003: add initState, rename animated_container (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: remove print statement 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 unified diff | Download patch
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/theme/colors.dart' as colors; 5 import 'package:sky/theme/colors.dart' as colors;
6 import 'package:sky/theme/typography.dart' as typography; 6 import 'package:sky/theme/typography.dart' as typography;
7 import 'package:sky/widgets/basic.dart'; 7 import 'package:sky/widgets/basic.dart';
8 import 'package:sky/widgets/default_text_style.dart'; 8 import 'package:sky/widgets/default_text_style.dart';
9 import 'package:sky/widgets/navigator.dart'; 9 import 'package:sky/widgets/navigator.dart';
10 import 'package:sky/widgets/theme.dart'; 10 import 'package:sky/widgets/theme.dart';
11 import 'package:sky/widgets/widget.dart'; 11 import 'package:sky/widgets/widget.dart';
12 import 'package:sky/widgets/task_description.dart'; 12 import 'package:sky/widgets/task_description.dart';
13 13
14 import 'stock_data.dart'; 14 import 'stock_data.dart';
15 import 'stock_home.dart'; 15 import 'stock_home.dart';
16 import 'stock_settings.dart'; 16 import 'stock_settings.dart';
17 import 'stock_types.dart'; 17 import 'stock_types.dart';
18 18
19 class StocksApp extends App { 19 class StocksApp extends App {
20 20
21 NavigationState _navigationState; 21 NavigationState _navigationState;
22 StocksApp() { 22 StocksApp();
abarth-chromium 2015/07/10 23:26:00 ditto
23
24 void initState() {
23 _navigationState = new NavigationState([ 25 _navigationState = new NavigationState([
24 new Route( 26 new Route(
25 name: '/', 27 name: '/',
26 builder: (navigator, route) => new StockHome(navigator, _stocks, optimis mSetting, modeUpdater) 28 builder: (navigator, route) => new StockHome(navigator, _stocks, optimis mSetting, modeUpdater)
27 ), 29 ),
28 new Route( 30 new Route(
29 name: '/settings', 31 name: '/settings',
30 builder: (navigator, route) => new StockSettings(navigator, optimismSett ing, backupSetting, settingsUpdater) 32 builder: (navigator, route) => new StockSettings(navigator, optimismSett ing, backupSetting, settingsUpdater)
31 ), 33 ),
32 ]); 34 ]);
35 super.initState();
33 } 36 }
34 37
35 void onBack() { 38 void onBack() {
36 if (_navigationState.hasPrevious()) { 39 if (_navigationState.hasPrevious()) {
37 setState(() { 40 setState(() {
38 _navigationState.pop(); 41 _navigationState.pop();
39 }); 42 });
40 } else { 43 } else {
41 super.onBack(); 44 super.onBack();
42 } 45 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 child: new Navigator(_navigationState) 95 child: new Navigator(_navigationState)
93 ) 96 )
94 ) 97 )
95 ); 98 );
96 } 99 }
97 } 100 }
98 101
99 void main() { 102 void main() {
100 runApp(new StocksApp()); 103 runApp(new StocksApp());
101 } 104 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698