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/components/action_bar.dart'; | 5 import 'package:sky/framework/components/action_bar.dart'; |
6 import 'package:sky/framework/components/drawer.dart'; | 6 import 'package:sky/framework/components/drawer.dart'; |
7 import 'package:sky/framework/components/drawer_header.dart'; | 7 import 'package:sky/framework/components/drawer_header.dart'; |
8 import 'package:sky/framework/components/floating_action_button.dart'; | 8 import 'package:sky/framework/components/floating_action_button.dart'; |
9 import 'package:sky/framework/components/icon.dart'; | 9 import 'package:sky/framework/components/icon.dart'; |
10 import 'package:sky/framework/components/input.dart'; | 10 import 'package:sky/framework/components/input.dart'; |
(...skipping 22 matching lines...) Expand all Loading... |
33 static Style _iconStyle = new Style(''' | 33 static Style _iconStyle = new Style(''' |
34 padding: 8px;''' | 34 padding: 8px;''' |
35 ); | 35 ); |
36 | 36 |
37 static Style _titleStyle = new Style(''' | 37 static Style _titleStyle = new Style(''' |
38 padding-left: 24px; | 38 padding-left: 24px; |
39 flex: 1; | 39 flex: 1; |
40 ${typography.white.title};''' | 40 ${typography.white.title};''' |
41 ); | 41 ); |
42 | 42 |
| 43 static Style _stocklistHeight = new Style(''' |
| 44 flex: 1;''' |
| 45 ); |
| 46 |
43 List<Stock> _sortedStocks; | 47 List<Stock> _sortedStocks; |
44 bool _isSearching = false; | 48 bool _isSearching = false; |
45 bool _isShowingMenu = false; | 49 bool _isShowingMenu = false; |
46 String _searchQuery; | 50 String _searchQuery; |
47 | 51 |
48 StocksApp() : super() { | 52 StocksApp() : super() { |
49 _sortedStocks = oracle.stocks; | 53 _sortedStocks = oracle.stocks; |
50 _sortedStocks.sort((a, b) => a.symbol.compareTo(b.symbol)); | 54 _sortedStocks.sort((a, b) => a.symbol.compareTo(b.symbol)); |
51 } | 55 } |
52 | 56 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 ), | 134 ), |
131 new EventTarget( | 135 new EventTarget( |
132 new Icon(key: 'more_white', style: _iconStyle, | 136 new Icon(key: 'more_white', style: _iconStyle, |
133 size: 24, | 137 size: 24, |
134 type: 'navigation/more_vert_white'), | 138 type: 'navigation/more_vert_white'), |
135 onGestureTap: _handleMenuClick | 139 onGestureTap: _handleMenuClick |
136 ) | 140 ) |
137 ] | 141 ] |
138 ); | 142 ); |
139 | 143 |
140 var list = new Stocklist(stocks: _sortedStocks, query: _searchQuery); | 144 var list = new StyleNode( |
| 145 new Stocklist(stocks: _sortedStocks, query: _searchQuery), |
| 146 _stocklistHeight); |
141 | 147 |
142 var fab = new FloatingActionButton(content: new Icon( | 148 var fab = new FloatingActionButton(content: new Icon( |
143 type: 'content/add_white', size: 24), level: 3); | 149 type: 'content/add_white', size: 24), level: 3); |
144 | 150 |
145 var children = [ | 151 var children = [ |
146 new Container( | 152 new Container( |
147 key: 'Content', | 153 key: 'Content', |
148 style: _style, | 154 style: _style, |
149 children: [toolbar, list] | 155 children: [toolbar, list] |
150 ), | 156 ), |
(...skipping 12 matching lines...) Expand all Loading... |
163 _menuController = null; | 169 _menuController = null; |
164 }); | 170 }); |
165 } | 171 } |
166 ); | 172 ); |
167 children.add(menu); | 173 children.add(menu); |
168 } | 174 } |
169 | 175 |
170 return new Container(key: 'StocksApp', children: children); | 176 return new Container(key: 'StocksApp', children: children); |
171 } | 177 } |
172 } | 178 } |
OLD | NEW |