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/icon_button.dart'; | 10 import 'package:sky/framework/components/icon_button.dart'; |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 Node build() { | 138 Node build() { |
139 List<Node> overlays = []; | 139 List<Node> overlays = []; |
140 | 140 |
141 if (_menuController != null) { | 141 if (_menuController != null) { |
142 overlays.add(new EventTarget( | 142 overlays.add(new EventTarget( |
143 new StockMenu(controller: _menuController), | 143 new StockMenu(controller: _menuController), |
144 onGestureTap: (_) { | 144 onGestureTap: (_) { |
145 // TODO(abarth): We should close the menu when you tap away from the | 145 // TODO(abarth): We should close the menu when you tap away from the |
146 // menu rather than when you tap on the menu. | 146 // menu rather than when you tap on the menu. |
147 setState(() { | 147 setState(() { |
148 _menuController.close(); | 148 _menuController.close().then((_) { |
149 _menuController = null; | 149 setState(() { |
| 150 _menuController = null; |
| 151 }); |
| 152 }); |
150 }); | 153 }); |
151 } | 154 } |
152 )); | 155 )); |
153 } | 156 } |
154 | 157 |
155 return new Scaffold( | 158 return new Scaffold( |
156 header: _isSearching ? buildSearchBar() : buildActionBar(), | 159 header: _isSearching ? buildSearchBar() : buildActionBar(), |
157 content: new Stocklist(stocks: _stocks, query: _searchQuery), | 160 content: new Stocklist(stocks: _stocks, query: _searchQuery), |
158 fab: new FloatingActionButton( | 161 fab: new FloatingActionButton( |
159 content: new Icon(type: 'content/add_white', size: 24), level: 3), | 162 content: new Icon(type: 'content/add_white', size: 24), level: 3), |
160 drawer: buildDrawer(), | 163 drawer: buildDrawer(), |
161 overlays: overlays | 164 overlays: overlays |
162 ); | 165 ); |
163 } | 166 } |
164 } | 167 } |
OLD | NEW |