| 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 'dart:sky' as sky; | 5 import 'dart:sky' as sky; |
| 6 | 6 |
| 7 import 'package:sky/animation/animation_performance.dart'; | 7 import 'package:sky/animation/animation_performance.dart'; |
| 8 import 'package:sky/animation/curves.dart'; | 8 import 'package:sky/animation/curves.dart'; |
| 9 import 'package:sky/theme/shadows.dart'; | 9 import 'package:sky/theme/shadows.dart'; |
| 10 import 'package:sky/widgets/animated_component.dart'; | 10 import 'package:sky/widgets/animated_component.dart'; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 performance.fling(velocity: velocityX / _kWidth); | 98 performance.fling(velocity: velocityX / _kWidth); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 class Drawer extends AnimatedComponent { | 102 class Drawer extends AnimatedComponent { |
| 103 Drawer({ | 103 Drawer({ |
| 104 String key, | 104 String key, |
| 105 this.controller, | 105 this.controller, |
| 106 this.children, | 106 this.children, |
| 107 this.level: 0 | 107 this.level: 0 |
| 108 }) : super(key: key) { | 108 }) : super(key: key); |
| 109 watchPerformance(controller.performance); | |
| 110 } | |
| 111 | 109 |
| 112 List<Widget> children; | 110 List<Widget> children; |
| 113 int level; | 111 int level; |
| 114 DrawerController controller; | 112 DrawerController controller; |
| 115 | 113 |
| 114 void initState() { |
| 115 watch(controller.performance); |
| 116 } |
| 117 |
| 116 void syncFields(Drawer source) { | 118 void syncFields(Drawer source) { |
| 117 children = source.children; | 119 children = source.children; |
| 118 level = source.level; | 120 level = source.level; |
| 119 controller = source.controller; | 121 controller = source.controller; |
| 120 super.syncFields(source); | 122 super.syncFields(source); |
| 121 } | 123 } |
| 122 | 124 |
| 123 // TODO(mpcomplete): the animation system should handle building, maybe? Or | 125 // TODO(mpcomplete): the animation system should handle building, maybe? Or |
| 124 // at least setting the transform. Figure out how this could work for things | 126 // at least setting the transform. Figure out how this could work for things |
| 125 // like fades, slides, rotates, pinch, etc. | 127 // like fades, slides, rotates, pinch, etc. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 146 child: new Stack([ mask, content ]), | 148 child: new Stack([ mask, content ]), |
| 147 onPointerDown: controller.handlePointerDown, | 149 onPointerDown: controller.handlePointerDown, |
| 148 onPointerMove: controller.handlePointerMove, | 150 onPointerMove: controller.handlePointerMove, |
| 149 onPointerUp: controller.handlePointerUp, | 151 onPointerUp: controller.handlePointerUp, |
| 150 onPointerCancel: controller.handlePointerCancel, | 152 onPointerCancel: controller.handlePointerCancel, |
| 151 onGestureFlingStart: controller.handleFlingStart | 153 onGestureFlingStart: controller.handleFlingStart |
| 152 ); | 154 ); |
| 153 } | 155 } |
| 154 | 156 |
| 155 } | 157 } |
| OLD | NEW |