| 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:vector_math/vector_math.dart'; | 5 import 'package:vector_math/vector_math.dart'; |
| 6 | 6 |
| 7 import '../animation/animation_performance.dart'; | 7 import 'package:sky/animation/animation_performance.dart'; |
| 8 import '../animation/curves.dart'; | 8 import 'package:sky/animation/curves.dart'; |
| 9 import '../base/lerp.dart'; | 9 import 'package:sky/base/lerp.dart'; |
| 10 import '../painting/box_painter.dart'; | 10 import 'package:sky/painting/box_painter.dart'; |
| 11 import '../theme/shadows.dart'; | 11 import 'package:sky/theme/shadows.dart'; |
| 12 import 'basic.dart'; | 12 import 'package:sky/widgets/basic.dart'; |
| 13 | 13 |
| 14 // This class builds a Builder object from a collection of optionally- | 14 // This class builds a Builder object from a collection of optionally- |
| 15 // animated properties. Use syncFields to update the Builder's properties, | 15 // animated properties. Use syncFields to update the Builder's properties, |
| 16 // which will optionally animate them using an AnimationPerformance. | 16 // which will optionally animate them using an AnimationPerformance. |
| 17 class AnimationBuilder { | 17 class AnimationBuilder { |
| 18 AnimatedType<double> opacity; | 18 AnimatedType<double> opacity; |
| 19 AnimatedType<Point> position; | 19 AnimatedType<Point> position; |
| 20 AnimatedType<double> shadow; | 20 AnimatedType<double> shadow; |
| 21 AnimatedColor backgroundColor; | 21 AnimatedColor backgroundColor; |
| 22 | 22 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 int level1 = level.floor(); | 113 int level1 = level.floor(); |
| 114 int level2 = level.ceil(); | 114 int level2 = level.ceil(); |
| 115 double t = level - level1.toDouble(); | 115 double t = level - level1.toDouble(); |
| 116 | 116 |
| 117 List<BoxShadow> shadow = new List<BoxShadow>(); | 117 List<BoxShadow> shadow = new List<BoxShadow>(); |
| 118 for (int i = 0; i < shadows[level1].length; ++i) | 118 for (int i = 0; i < shadows[level1].length; ++i) |
| 119 shadow.add(lerpBoxShadow(shadows[level1][i], shadows[level2][i], t)); | 119 shadow.add(lerpBoxShadow(shadows[level1][i], shadows[level2][i], t)); |
| 120 return shadow; | 120 return shadow; |
| 121 } | 121 } |
| OLD | NEW |