| 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/components2/tool_bar.dart'; | 5 // import 'package:sky/framework/components2/tool_bar.dart'; |
| 6 // import 'package:sky/framework/components2/drawer.dart'; | 6 // import 'package:sky/framework/components2/drawer.dart'; |
| 7 // import 'package:sky/framework/components2/drawer_header.dart'; | 7 // import 'package:sky/framework/components2/drawer_header.dart'; |
| 8 // import 'package:sky/framework/components2/floating_action_button.dart'; | 8 // import 'package:sky/framework/components2/floating_action_button.dart'; |
| 9 // import 'package:sky/framework/components2/icon.dart'; | 9 // import 'package:sky/framework/components2/icon.dart'; |
| 10 // import 'package:sky/framework/components2/icon_button.dart'; | 10 // import 'package:sky/framework/components2/icon_button.dart'; |
| 11 // import 'package:sky/framework/components2/input.dart'; | 11 // import 'package:sky/framework/components2/input.dart'; |
| 12 // import 'package:sky/framework/components2/menu_divider.dart'; | 12 // import 'package:sky/framework/components2/menu_divider.dart'; |
| 13 // import 'package:sky/framework/components2/menu_item.dart'; | 13 // import 'package:sky/framework/components2/menu_item.dart'; |
| 14 // import 'package:sky/framework/components2/modal_overlay.dart'; | 14 // import 'package:sky/framework/components2/modal_overlay.dart'; |
| 15 // import 'package:sky/framework/components2/popup_menu.dart'; | 15 // import 'package:sky/framework/components2/popup_menu.dart'; |
| 16 // import 'package:sky/framework/components2/radio.dart'; | 16 // import 'package:sky/framework/components2/radio.dart'; |
| 17 // import 'package:sky/framework/components2/scaffold.dart'; | 17 import 'package:sky/framework/components2/scaffold.dart'; |
| 18 import 'package:sky/framework/fn2.dart'; | 18 import 'package:sky/framework/fn2.dart'; |
| 19 import 'package:sky/framework/theme/typography.dart' as typography; | 19 import 'package:sky/framework/theme/typography.dart' as typography; |
| 20 import 'package:sky/framework/theme/colors.dart'; | 20 import 'package:sky/framework/theme/colors.dart'; |
| 21 import 'stock_data.dart'; | 21 import 'stock_data.dart'; |
| 22 // import 'stock_list.dart'; | 22 // import 'stock_list.dart'; |
| 23 // import 'stock_menu.dart'; | 23 // import 'stock_menu.dart'; |
| 24 | 24 |
| 25 import 'dart:async'; | 25 import 'dart:async'; |
| 26 import 'package:sky/framework/layout2.dart'; | 26 import 'package:sky/framework/layout2.dart'; |
| 27 | 27 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // icon: 'action/settings', | 154 // icon: 'action/settings', |
| 155 // children: [new Text('Settings')]), | 155 // children: [new Text('Settings')]), |
| 156 // new MenuItem( | 156 // new MenuItem( |
| 157 // key: 'Help & Feedback', | 157 // key: 'Help & Feedback', |
| 158 // icon: 'action/help', | 158 // icon: 'action/help', |
| 159 // children: [new Text('Help & Feedback')]) | 159 // children: [new Text('Help & Feedback')]) |
| 160 // ] | 160 // ] |
| 161 // ); | 161 // ); |
| 162 // } | 162 // } |
| 163 | 163 |
| 164 // UINode buildToolBar() { | 164 UINode buildToolBar() { |
| 165 // return new StyleNode( | 165 return new Rectangle(0xFF00FF00); |
| 166 // new ToolBar( | 166 // return new StyleNode( |
| 167 // left: new IconButton( | 167 // new ToolBar( |
| 168 // icon: 'navigation/menu_white', | 168 // left: new IconButton( |
| 169 // onGestureTap: _drawerController.toggle), | 169 // icon: 'navigation/menu_white', |
| 170 // center: new Container( | 170 // onGestureTap: _drawerController.toggle), |
| 171 // style: _titleStyle, | 171 // center: new Container( |
| 172 // children: [new Text('Stocks')]), | 172 // style: _titleStyle, |
| 173 // right: [ | 173 // children: [new Text('Stocks')]), |
| 174 // new IconButton( | 174 // right: [ |
| 175 // icon: 'action/search_white', | 175 // new IconButton( |
| 176 // onGestureTap: _handleSearchBegin), | 176 // icon: 'action/search_white', |
| 177 // new IconButton( | 177 // onGestureTap: _handleSearchBegin), |
| 178 // icon: 'navigation/more_vert_white', | 178 // new IconButton( |
| 179 // onGestureTap: _handleMenuShow) | 179 // icon: 'navigation/more_vert_white', |
| 180 // ]), | 180 // onGestureTap: _handleMenuShow) |
| 181 // _toolBarStyle); | 181 // ]), |
| 182 // } | 182 // _toolBarStyle); |
| 183 } |
| 183 | 184 |
| 184 // // TODO(abarth): Should we factor this into a SearchBar in the framework? | 185 // TODO(abarth): Should we factor this into a SearchBar in the framework? |
| 185 // UINode buildSearchBar() { | 186 UINode buildSearchBar() { |
| 186 // return new StyleNode( | 187 // return new StyleNode( |
| 187 // new ToolBar( | 188 // new ToolBar( |
| 188 // left: new IconButton( | 189 // left: new IconButton( |
| 189 // icon: 'navigation/arrow_back_grey600', | 190 // icon: 'navigation/arrow_back_grey600', |
| 190 // onGestureTap: _handleSearchEnd), | 191 // onGestureTap: _handleSearchEnd), |
| 191 // center: new Input( | 192 // center: new Input( |
| 192 // focused: true, | 193 // focused: true, |
| 193 // placeholder: 'Search stocks', | 194 // placeholder: 'Search stocks', |
| 194 // onChanged: _handleSearchQueryChanged)), | 195 // onChanged: _handleSearchQueryChanged)), |
| 195 // _searchBarStyle); | 196 // _searchBarStyle); |
| 196 // } | 197 } |
| 197 | 198 |
| 198 // void addMenuToOverlays(List<UINode> overlays) { | 199 // void addMenuToOverlays(List<UINode> overlays) { |
| 199 // if (_menuController == null) | 200 // if (_menuController == null) |
| 200 // return; | 201 // return; |
| 201 // overlays.add(new ModalOverlay( | 202 // overlays.add(new ModalOverlay( |
| 202 // children: [new StockMenu( | 203 // children: [new StockMenu( |
| 203 // controller: _menuController, | 204 // controller: _menuController, |
| 204 // autorefresh: _autorefresh, | 205 // autorefresh: _autorefresh, |
| 205 // onAutorefreshChanged: _handleAutorefreshChanged | 206 // onAutorefreshChanged: _handleAutorefreshChanged |
| 206 // )], | 207 // )], |
| 207 // onDismiss: _handleMenuHide)); | 208 // onDismiss: _handleMenuHide)); |
| 208 // } | 209 // } |
| 209 | 210 |
| 210 UINode build() { | 211 UINode build() { |
| 211 // List<UINode> overlays = []; | 212 // List<UINode> overlays = []; |
| 212 // addMenuToOverlays(overlays); | 213 // addMenuToOverlays(overlays); |
| 213 | 214 |
| 214 // return new Scaffold( | 215 return new Scaffold( |
| 215 // header: _isSearching ? buildSearchBar() : buildToolBar(), | 216 toolbar: _isSearching ? buildSearchBar() : buildToolBar() |
| 216 // content: new Stocklist(stocks: _stocks, query: _searchQuery), | 217 // , |
| 217 // fab: new FloatingActionButton( | 218 // body: new Stocklist(stocks: _stocks, query: _searchQuery), |
| 219 // floatingActionButton: new FloatingActionButton( |
| 218 // content: new Icon(type: 'content/add_white', size: 24), level: 3), | 220 // content: new Icon(type: 'content/add_white', size: 24), level: 3), |
| 219 // drawer: _drawerShowing ? buildDrawer() : null, | 221 // drawer: _drawerShowing ? buildDrawer() : null, |
| 220 // overlays: overlays | 222 // overlays: overlays |
| 221 // ); | 223 ); |
| 222 } | 224 } |
| 223 } | 225 } |
| 224 | 226 |
| 225 void main() { | 227 void main() { |
| 228 print("starting stocks app!"); |
| 226 new StocksApp(); | 229 new StocksApp(); |
| 227 } | 230 } |
| OLD | NEW |