| 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/animation_builder.dart'; | 8 import 'package:sky/widgets/animation_builder.dart'; |
| 9 import 'package:sky/theme/colors.dart' as colors; | 9 import 'package:sky/theme/colors.dart' as colors; |
| 10 import 'package:sky/widgets/basic.dart'; | 10 import 'package:sky/widgets/basic.dart'; |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 actions: [new SnackBarAction(label: "UNDO", onPressed: _handleUndo)] | 279 actions: [new SnackBarAction(label: "UNDO", onPressed: _handleUndo)] |
| 280 )); | 280 )); |
| 281 } | 281 } |
| 282 | 282 |
| 283 void _handleStockPurchased() { | 283 void _handleStockPurchased() { |
| 284 setState(() { | 284 setState(() { |
| 285 _snackbarTransform = new AnimationBuilder() | 285 _snackbarTransform = new AnimationBuilder() |
| 286 ..position = new AnimatedType<Point>(const Point(0.0, 45.0), end: Point.
origin); | 286 ..position = new AnimatedType<Point>(const Point(0.0, 45.0), end: Point.
origin); |
| 287 var performance = _snackbarTransform.createPerformance( | 287 var performance = _snackbarTransform.createPerformance( |
| 288 [_snackbarTransform.position], duration: _kSnackbarSlideDuration); | 288 [_snackbarTransform.position], duration: _kSnackbarSlideDuration); |
| 289 watchPerformance(performance); | 289 watch(performance); |
| 290 performance.play(); | 290 performance.play(); |
| 291 }); | 291 }); |
| 292 } | 292 } |
| 293 | 293 |
| 294 Widget buildFloatingActionButton() { | 294 Widget buildFloatingActionButton() { |
| 295 var widget = new FloatingActionButton( | 295 var widget = new FloatingActionButton( |
| 296 child: new Icon(type: 'content/add', size: 24), | 296 child: new Icon(type: 'content/add', size: 24), |
| 297 backgroundColor: colors.RedAccent[200], | 297 backgroundColor: colors.RedAccent[200], |
| 298 onPressed: _handleStockPurchased | 298 onPressed: _handleStockPurchased |
| 299 ); | 299 ); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 321 body: buildTabNavigator(), | 321 body: buildTabNavigator(), |
| 322 snackBar: buildSnackBar(), | 322 snackBar: buildSnackBar(), |
| 323 floatingActionButton: buildFloatingActionButton(), | 323 floatingActionButton: buildFloatingActionButton(), |
| 324 drawer: _drawerShowing ? buildDrawer() : null | 324 drawer: _drawerShowing ? buildDrawer() : null |
| 325 ), | 325 ), |
| 326 ]; | 326 ]; |
| 327 addMenuToOverlays(overlays); | 327 addMenuToOverlays(overlays); |
| 328 return new Stack(overlays); | 328 return new Stack(overlays); |
| 329 } | 329 } |
| 330 } | 330 } |
| OLD | NEW |