| 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/rendering/sky_binding.dart'; | |
| 6 import 'package:sky/theme/colors.dart' as colors; | 5 import 'package:sky/theme/colors.dart' as colors; |
| 7 import 'package:sky/theme/theme_data.dart'; | 6 import 'package:sky/theme/theme_data.dart'; |
| 8 import 'package:sky/widgets/basic.dart'; | 7 import 'package:sky/widgets/basic.dart'; |
| 9 import 'package:sky/widgets/navigator.dart'; | 8 import 'package:sky/widgets/navigator.dart'; |
| 10 import 'package:sky/widgets/theme.dart'; | 9 import 'package:sky/widgets/theme.dart'; |
| 11 import 'package:sky/widgets/widget.dart'; | 10 import 'package:sky/widgets/widget.dart'; |
| 12 | 11 |
| 13 import 'stock_data.dart'; | 12 import 'stock_data.dart'; |
| 14 import 'stock_home.dart'; | 13 import 'stock_home.dart'; |
| 15 import 'stock_settings.dart'; | 14 import 'stock_settings.dart'; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 final List<Stock> _stocks = []; | 53 final List<Stock> _stocks = []; |
| 55 void didMount() { | 54 void didMount() { |
| 56 super.didMount(); | 55 super.didMount(); |
| 57 new StockDataFetcher((StockData data) { | 56 new StockDataFetcher((StockData data) { |
| 58 setState(() { | 57 setState(() { |
| 59 data.appendTo(_stocks); | 58 data.appendTo(_stocks); |
| 60 }); | 59 }); |
| 61 }); | 60 }); |
| 62 } | 61 } |
| 63 | 62 |
| 64 Widget build() { | 63 Widget build() { |
| 65 | 64 |
| 66 ThemeData theme; | 65 ThemeData theme; |
| 67 if (stockMode == StockMode.optimistic) { | 66 if (stockMode == StockMode.optimistic) { |
| 68 theme = new ThemeData.light( | 67 theme = new ThemeData.light( |
| 69 primary: colors.Purple, | 68 primary: colors.Purple, |
| 70 accent: colors.RedAccent, | 69 accent: colors.RedAccent, |
| 71 darkToolbar: true | 70 darkToolbar: true |
| 72 ); | 71 ); |
| 73 } else { | 72 } else { |
| 74 theme = new ThemeData.dark( | 73 theme = new ThemeData.dark( |
| 75 primary: colors.Red, | 74 primary: colors.Red, |
| 76 accent: colors.PurpleAccent | 75 accent: colors.PurpleAccent |
| 77 ); | 76 ); |
| 78 } | 77 } |
| 79 | 78 |
| 80 return new Theme( | 79 return new Theme( |
| 81 data: theme, | 80 data: theme, |
| 82 child: new Navigator(_navigationState) | 81 child: new Navigator(_navigationState) |
| 83 ); | 82 ); |
| 84 } | 83 } |
| 85 } | 84 } |
| 86 | 85 |
| 87 void main() { | 86 void main() { |
| 88 runApp(new StocksApp()); | 87 runApp(new StocksApp()); |
| 89 } | 88 } |
| OLD | NEW |