| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 }) : super(key: key) { | 102 }) : super(key: key) { |
| 103 animate(controller.position, (double value) { | 103 animate(controller.position, (double value) { |
| 104 _position = value; | 104 _position = value; |
| 105 }); | 105 }); |
| 106 } | 106 } |
| 107 | 107 |
| 108 List<UINode> children; | 108 List<UINode> children; |
| 109 int level; | 109 int level; |
| 110 DrawerController controller; | 110 DrawerController controller; |
| 111 | 111 |
| 112 void syncFields(Drawer source) { |
| 113 children = source.children; |
| 114 level = source.level; |
| 115 controller = source.controller; |
| 116 super.syncFields(source); |
| 117 } |
| 118 |
| 112 double _position; | 119 double _position; |
| 113 | 120 |
| 114 UINode build() { | 121 UINode build() { |
| 115 Matrix4 transform = new Matrix4.identity(); | 122 Matrix4 transform = new Matrix4.identity(); |
| 116 transform.translate(_position); | 123 transform.translate(_position); |
| 117 | 124 |
| 118 double scaler = _position / _kWidth + 1; | 125 double scaler = _position / _kWidth + 1; |
| 119 Color maskColor = new Color.fromARGB((0x7F * scaler).floor(), 0, 0, 0); | 126 Color maskColor = new Color.fromARGB((0x7F * scaler).floor(), 0, 0, 0); |
| 120 | 127 |
| 121 var mask = new EventListenerNode( | 128 var mask = new EventListenerNode( |
| (...skipping 16 matching lines...) Expand all Loading... |
| 138 children: [ mask, content ] | 145 children: [ mask, content ] |
| 139 ), | 146 ), |
| 140 onPointerDown: controller.handlePointerDown, | 147 onPointerDown: controller.handlePointerDown, |
| 141 onPointerMove: controller.handlePointerMove, | 148 onPointerMove: controller.handlePointerMove, |
| 142 onPointerUp: controller.handlePointerUp, | 149 onPointerUp: controller.handlePointerUp, |
| 143 onPointerCancel: controller.handlePointerCancel | 150 onPointerCancel: controller.handlePointerCancel |
| 144 ); | 151 ); |
| 145 } | 152 } |
| 146 | 153 |
| 147 } | 154 } |
| OLD | NEW |