| 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 '../animation/animation_performance.dart'; | 7 import '../animation/animation_performance.dart'; |
| 8 import '../animation/curves.dart'; | 8 import '../animation/curves.dart'; |
| 9 import '../theme/shadows.dart'; | 9 import '../theme/shadows.dart'; |
| 10 import 'animated_component.dart'; | 10 import 'animated_component.dart'; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // initial timeline when animating (so it doesn't look linear). | 33 // initial timeline when animating (so it doesn't look linear). |
| 34 const Curve _kAnimationCurve = linear; | 34 const Curve _kAnimationCurve = linear; |
| 35 | 35 |
| 36 typedef void DrawerStatusChangeHandler (bool showing); | 36 typedef void DrawerStatusChangeHandler (bool showing); |
| 37 | 37 |
| 38 class DrawerController { | 38 class DrawerController { |
| 39 DrawerController(this.onStatusChange) { | 39 DrawerController(this.onStatusChange) { |
| 40 container = new AnimatedContainer() | 40 container = new AnimatedContainer() |
| 41 ..position = new AnimatedType<Point>( | 41 ..position = new AnimatedType<Point>( |
| 42 new Point(-_kWidth, 0.0), end: Point.origin, curve: _kAnimationCurve); | 42 new Point(-_kWidth, 0.0), end: Point.origin, curve: _kAnimationCurve); |
| 43 performance = container.createPerformance(container.position, | 43 performance = container.createPerformance([container.position], |
| 44 duration: _kBaseSettleDuration) | 44 duration: _kBaseSettleDuration) |
| 45 ..addListener(_checkValue); | 45 ..addListener(_checkValue); |
| 46 } | 46 } |
| 47 final DrawerStatusChangeHandler onStatusChange; | 47 final DrawerStatusChangeHandler onStatusChange; |
| 48 | 48 |
| 49 AnimationPerformance performance; | 49 AnimationPerformance performance; |
| 50 AnimatedContainer container; | 50 AnimatedContainer container; |
| 51 | 51 |
| 52 double get xPosition => container.position.value.x; | 52 double get xPosition => container.position.value.x; |
| 53 | 53 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 child: new Stack([ mask, content ]), | 145 child: new Stack([ mask, content ]), |
| 146 onPointerDown: controller.handlePointerDown, | 146 onPointerDown: controller.handlePointerDown, |
| 147 onPointerMove: controller.handlePointerMove, | 147 onPointerMove: controller.handlePointerMove, |
| 148 onPointerUp: controller.handlePointerUp, | 148 onPointerUp: controller.handlePointerUp, |
| 149 onPointerCancel: controller.handlePointerCancel, | 149 onPointerCancel: controller.handlePointerCancel, |
| 150 onGestureFlingStart: controller.handleFlingStart | 150 onGestureFlingStart: controller.handleFlingStart |
| 151 ); | 151 ); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } | 154 } |
| OLD | NEW |