| 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 '../animation/animated_value.dart'; | 5 import '../animation/animated_value.dart'; |
| 6 import '../animation/curves.dart'; | 6 import '../animation/curves.dart'; |
| 7 import '../fn2.dart'; | 7 import '../fn2.dart'; |
| 8 import '../theme2/colors.dart'; | 8 import '../theme2/colors.dart'; |
| 9 import '../theme2/shadows.dart'; | 9 import '../theme2/shadows.dart'; |
| 10 import 'animated_component.dart'; | 10 import 'animated_component.dart'; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 DrawerController controller; | 97 DrawerController controller; |
| 98 | 98 |
| 99 double _position; | 99 double _position; |
| 100 | 100 |
| 101 Drawer({ | 101 Drawer({ |
| 102 Object key, | 102 Object key, |
| 103 this.controller, | 103 this.controller, |
| 104 this.children, | 104 this.children, |
| 105 this.level: 0 | 105 this.level: 0 |
| 106 }) : super(key: key) { | 106 }) : super(key: key) { |
| 107 animateField(controller.position, #_position); | 107 animate(controller.position, (double value) { |
| 108 _position = value; |
| 109 }); |
| 108 } | 110 } |
| 109 | 111 |
| 110 UINode build() { | 112 UINode build() { |
| 111 Matrix4 transform = new Matrix4.identity(); | 113 Matrix4 transform = new Matrix4.identity(); |
| 112 transform.translate(_position); | 114 transform.translate(_position); |
| 113 | 115 |
| 114 double scaler = _position / _kWidth + 1; | 116 double scaler = _position / _kWidth + 1; |
| 115 Color maskColor = new Color.fromARGB((0x7F * scaler).floor(), 0, 0, 0); | 117 Color maskColor = new Color.fromARGB((0x7F * scaler).floor(), 0, 0, 0); |
| 116 | 118 |
| 117 var mask = new EventListenerNode( | 119 var mask = new EventListenerNode( |
| (...skipping 15 matching lines...) Expand all Loading... |
| 133 new StackContainer( | 135 new StackContainer( |
| 134 children: [ mask, content ] | 136 children: [ mask, content ] |
| 135 ), | 137 ), |
| 136 onPointerDown: controller.handlePointerDown, | 138 onPointerDown: controller.handlePointerDown, |
| 137 onPointerMove: controller.handlePointerMove, | 139 onPointerMove: controller.handlePointerMove, |
| 138 onPointerUp: controller.handlePointerUp, | 140 onPointerUp: controller.handlePointerUp, |
| 139 onPointerCancel: controller.handlePointerCancel | 141 onPointerCancel: controller.handlePointerCancel |
| 140 ); | 142 ); |
| 141 } | 143 } |
| 142 } | 144 } |
| OLD | NEW |