Chromium Code Reviews| 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/editing/input.dart'; | 5 import 'package:sky/editing/input.dart'; |
| 6 import 'package:sky/widgets/basic.dart'; | 6 import 'package:sky/widgets/basic.dart'; |
| 7 import 'package:sky/widgets/drawer.dart'; | 7 import 'package:sky/widgets/drawer.dart'; |
| 8 import 'package:sky/widgets/drawer_header.dart'; | 8 import 'package:sky/widgets/drawer_header.dart'; |
| 9 import 'package:sky/widgets/floating_action_button.dart'; | 9 import 'package:sky/widgets/floating_action_button.dart'; |
| 10 import 'package:sky/widgets/icon.dart'; | 10 import 'package:sky/widgets/icon.dart'; |
| 11 import 'package:sky/widgets/icon_button.dart'; | 11 import 'package:sky/widgets/icon_button.dart'; |
| 12 import 'package:sky/widgets/menu_divider.dart'; | 12 import 'package:sky/widgets/menu_divider.dart'; |
| 13 import 'package:sky/widgets/menu_item.dart'; | 13 import 'package:sky/widgets/menu_item.dart'; |
| 14 import 'package:sky/widgets/modal_overlay.dart'; | 14 import 'package:sky/widgets/modal_overlay.dart'; |
| 15 import 'package:sky/widgets/navigator.dart'; | 15 import 'package:sky/widgets/navigator.dart'; |
| 16 import 'package:sky/widgets/popup_menu.dart'; | 16 import 'package:sky/widgets/popup_menu.dart'; |
| 17 import 'package:sky/widgets/radio.dart'; | 17 import 'package:sky/widgets/radio.dart'; |
| 18 import 'package:sky/widgets/snack_bar.dart'; | 18 import 'package:sky/widgets/snack_bar.dart'; |
| 19 import 'package:sky/widgets/scaffold.dart'; | 19 import 'package:sky/widgets/scaffold.dart'; |
| 20 import 'package:sky/widgets/tabs.dart'; | 20 import 'package:sky/widgets/tabs.dart'; |
| 21 import 'package:sky/widgets/theme.dart'; | 21 import 'package:sky/widgets/theme.dart'; |
| 22 import 'package:sky/widgets/tool_bar.dart'; | 22 import 'package:sky/widgets/tool_bar.dart'; |
| 23 import 'package:sky/widgets/widget.dart'; | 23 import 'package:sky/widgets/widget.dart'; |
| 24 | 24 |
| 25 import 'package:vector_math/vector_math.dart'; | |
| 26 | |
| 25 import 'stock_data.dart'; | 27 import 'stock_data.dart'; |
| 26 import 'stock_list.dart'; | 28 import 'stock_list.dart'; |
| 27 import 'stock_menu.dart'; | 29 import 'stock_menu.dart'; |
| 28 import 'stock_types.dart'; | 30 import 'stock_types.dart'; |
| 29 | 31 |
| 30 typedef void ModeUpdater(StockMode mode); | 32 typedef void ModeUpdater(StockMode mode); |
| 31 | 33 |
| 32 class StockHome extends StatefulComponent { | 34 class StockHome extends StatefulComponent { |
| 33 | 35 |
| 34 StockHome(this.navigator, this.stocks, this.stockMode, this.modeUpdater) { | 36 StockHome(this.navigator, this.stocks, this.stockMode, this.modeUpdater) { |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 | 250 |
| 249 void _handleUndo() { | 251 void _handleUndo() { |
| 250 setState(() { | 252 setState(() { |
| 251 _isShowingSnackBar = false; | 253 _isShowingSnackBar = false; |
| 252 }); | 254 }); |
| 253 } | 255 } |
| 254 | 256 |
| 255 Widget buildSnackBar() { | 257 Widget buildSnackBar() { |
| 256 if (!_isShowingSnackBar) | 258 if (!_isShowingSnackBar) |
| 257 return null; | 259 return null; |
| 258 return new SnackBar( | 260 Matrix4 transform = new Matrix4.identity(); |
|
Matt Perry
2015/07/08 20:42:13
Ignore this. I want to use an AnimatedContainer he
abarth-chromium
2015/07/08 21:02:04
Does that mean you're going to remove this part of
Matt Perry
2015/07/08 21:41:03
Yep.
| |
| 261 transform.translate(0.0, -300.0); | |
| 262 return new Transform( | |
| 263 transform: transform, | |
| 264 child: | |
| 265 new SnackBar( | |
| 259 content: new Text("Stock purchased!"), | 266 content: new Text("Stock purchased!"), |
| 260 actions: [new SnackBarAction(label: "UNDO", onPressed: _handleUndo)] | 267 actions: [new SnackBarAction(label: "UNDO", onPressed: _handleUndo)] |
| 261 ); | 268 ) |
| 269 ); | |
| 262 } | 270 } |
| 263 | 271 |
| 264 void _handleStockPurchased() { | 272 void _handleStockPurchased() { |
| 265 setState(() { | 273 setState(() { |
| 266 _isShowingSnackBar = true; | 274 _isShowingSnackBar = true; |
| 267 }); | 275 }); |
| 268 } | 276 } |
| 269 | 277 |
| 270 Widget buildFloatingActionButton() { | 278 Widget buildFloatingActionButton() { |
| 271 return new FloatingActionButton( | 279 return new FloatingActionButton( |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 293 body: buildTabNavigator(), | 301 body: buildTabNavigator(), |
| 294 snackBar: buildSnackBar(), | 302 snackBar: buildSnackBar(), |
| 295 floatingActionButton: buildFloatingActionButton(), | 303 floatingActionButton: buildFloatingActionButton(), |
| 296 drawer: _drawerShowing ? buildDrawer() : null | 304 drawer: _drawerShowing ? buildDrawer() : null |
| 297 ), | 305 ), |
| 298 ]; | 306 ]; |
| 299 addMenuToOverlays(overlays); | 307 addMenuToOverlays(overlays); |
| 300 return new Stack(overlays); | 308 return new Stack(overlays); |
| 301 } | 309 } |
| 302 } | 310 } |
| OLD | NEW |