OLD | NEW |
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/framework/app.dart'; |
5 import 'package:sky/framework/editing2/input.dart'; | 6 import 'package:sky/framework/editing2/input.dart'; |
| 7 import 'package:sky/framework/rendering/box.dart'; |
6 import 'package:sky/framework/theme2/colors.dart' as colors; | 8 import 'package:sky/framework/theme2/colors.dart' as colors; |
7 import 'package:sky/framework/widgets/drawer.dart'; | 9 import 'package:sky/framework/widgets/drawer.dart'; |
8 import 'package:sky/framework/widgets/drawer_header.dart'; | 10 import 'package:sky/framework/widgets/drawer_header.dart'; |
9 import 'package:sky/framework/widgets/floating_action_button.dart'; | 11 import 'package:sky/framework/widgets/floating_action_button.dart'; |
10 import 'package:sky/framework/widgets/icon.dart'; | 12 import 'package:sky/framework/widgets/icon.dart'; |
11 import 'package:sky/framework/widgets/icon_button.dart'; | 13 import 'package:sky/framework/widgets/icon_button.dart'; |
12 import 'package:sky/framework/widgets/menu_divider.dart'; | 14 import 'package:sky/framework/widgets/menu_divider.dart'; |
13 import 'package:sky/framework/widgets/menu_item.dart'; | 15 import 'package:sky/framework/widgets/menu_item.dart'; |
14 import 'package:sky/framework/widgets/modal_overlay.dart'; | 16 import 'package:sky/framework/widgets/modal_overlay.dart'; |
15 import 'package:sky/framework/widgets/popup_menu.dart'; | 17 import 'package:sky/framework/widgets/popup_menu.dart'; |
16 import 'package:sky/framework/widgets/radio.dart'; | 18 import 'package:sky/framework/widgets/radio.dart'; |
17 import 'package:sky/framework/widgets/scaffold.dart'; | 19 import 'package:sky/framework/widgets/scaffold.dart'; |
18 import 'package:sky/framework/widgets/tool_bar.dart'; | 20 import 'package:sky/framework/widgets/tool_bar.dart'; |
19 import 'package:sky/framework/widgets/ui_node.dart'; | 21 import 'package:sky/framework/widgets/ui_node.dart'; |
20 import 'package:sky/framework/widgets/wrappers.dart'; | 22 import 'package:sky/framework/widgets/wrappers.dart'; |
21 | 23 |
22 import 'stock_data.dart'; | 24 import 'stock_data.dart'; |
23 import 'stock_list.dart'; | 25 import 'stock_list.dart'; |
24 import 'stock_menu.dart'; | 26 import 'stock_menu.dart'; |
25 | 27 |
26 enum StockMode { optimistic, pessimistic } | 28 enum StockMode { optimistic, pessimistic } |
27 | 29 |
28 class StocksApp extends App { | 30 class StocksApp extends App { |
29 | 31 |
30 // static final Style _titleStyle = new Style(''' | 32 // static final Style _titleStyle = new Style(''' |
31 // ${typography.white.title};'''); | 33 // ${typography.white.title};'''); |
32 | 34 |
33 List<Stock> _stocks = []; | 35 List<Stock> _stocks = []; |
34 | 36 |
35 StocksApp() : super() { | 37 StocksApp({ RenderView renderViewOverride }) : super(renderViewOverride: rende
rViewOverride) { |
36 // if (debug) | 38 // if (debug) |
37 // new Timer(new Duration(seconds: 1), dumpState); | 39 // new Timer(new Duration(seconds: 1), dumpState); |
38 new StockDataFetcher((StockData data) { | 40 new StockDataFetcher((StockData data) { |
39 setState(() { | 41 setState(() { |
40 data.appendTo(_stocks); | 42 data.appendTo(_stocks); |
41 }); | 43 }); |
42 }); | 44 }); |
43 _drawerController = new DrawerController(_handleDrawerStatusChanged); | 45 _drawerController = new DrawerController(_handleDrawerStatusChanged); |
44 } | 46 } |
45 | 47 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 214 } |
213 | 215 |
214 void main() { | 216 void main() { |
215 print("starting stocks app!"); | 217 print("starting stocks app!"); |
216 App app = new StocksApp(); | 218 App app = new StocksApp(); |
217 UINodeAppView.appView.onFrame = () { | 219 UINodeAppView.appView.onFrame = () { |
218 // uncomment this for debugging: | 220 // uncomment this for debugging: |
219 // app.appView.debugDumpRenderTree(); | 221 // app.appView.debugDumpRenderTree(); |
220 }; | 222 }; |
221 } | 223 } |
OLD | NEW |