| 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/animation/animation_performance.dart'; | 6 import 'package:sky/animation/animation_performance.dart'; |
| 7 import 'package:sky/widgets/animated_component.dart'; | 7 import 'package:sky/widgets/animated_component.dart'; |
| 8 import 'package:sky/widgets/animated_container.dart'; | 8 import 'package:sky/widgets/animated_container.dart'; |
| 9 import 'package:sky/widgets/basic.dart'; | 9 import 'package:sky/widgets/basic.dart'; |
| 10 import 'package:sky/widgets/drawer.dart'; | 10 import 'package:sky/widgets/drawer.dart'; |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 content: new Text("Stock purchased!"), | 265 content: new Text("Stock purchased!"), |
| 266 actions: [new SnackBarAction(label: "UNDO", onPressed: _handleUndo)] | 266 actions: [new SnackBarAction(label: "UNDO", onPressed: _handleUndo)] |
| 267 )); | 267 )); |
| 268 } | 268 } |
| 269 | 269 |
| 270 void _handleStockPurchased() { | 270 void _handleStockPurchased() { |
| 271 setState(() { | 271 setState(() { |
| 272 _snackbarTransform = new AnimatedContainer() | 272 _snackbarTransform = new AnimatedContainer() |
| 273 ..position = new AnimatedType<Point>(const Point(0.0, 45.0), end: Point.
origin); | 273 ..position = new AnimatedType<Point>(const Point(0.0, 45.0), end: Point.
origin); |
| 274 var performance = _snackbarTransform.createPerformance( | 274 var performance = _snackbarTransform.createPerformance( |
| 275 _snackbarTransform.position, duration: _kSnackbarSlideDuration); | 275 [_snackbarTransform.position], duration: _kSnackbarSlideDuration); |
| 276 watchPerformance(performance); | 276 watchPerformance(performance); |
| 277 performance.play(); | 277 performance.play(); |
| 278 }); | 278 }); |
| 279 } | 279 } |
| 280 | 280 |
| 281 Widget buildFloatingActionButton() { | 281 Widget buildFloatingActionButton() { |
| 282 var widget = new FloatingActionButton( | 282 var widget = new FloatingActionButton( |
| 283 child: new Icon(type: 'content/add_white', size: 24), | 283 child: new Icon(type: 'content/add_white', size: 24), |
| 284 onPressed: _handleStockPurchased | 284 onPressed: _handleStockPurchased |
| 285 ); | 285 ); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 307 body: buildTabNavigator(), | 307 body: buildTabNavigator(), |
| 308 snackBar: buildSnackBar(), | 308 snackBar: buildSnackBar(), |
| 309 floatingActionButton: buildFloatingActionButton(), | 309 floatingActionButton: buildFloatingActionButton(), |
| 310 drawer: _drawerShowing ? buildDrawer() : null | 310 drawer: _drawerShowing ? buildDrawer() : null |
| 311 ), | 311 ), |
| 312 ]; | 312 ]; |
| 313 addMenuToOverlays(overlays); | 313 addMenuToOverlays(overlays); |
| 314 return new Stack(overlays); | 314 return new Stack(overlays); |
| 315 } | 315 } |
| 316 } | 316 } |
| OLD | NEW |