| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 this.children, | 105 this.children, |
| 106 this.level: 0 | 106 this.level: 0 |
| 107 }) : super(key: key) { | 107 }) : super(key: key) { |
| 108 watchPerformance(controller.performance); | 108 watchPerformance(controller.performance); |
| 109 } | 109 } |
| 110 | 110 |
| 111 List<Widget> children; | 111 List<Widget> children; |
| 112 int level; | 112 int level; |
| 113 DrawerController controller; | 113 DrawerController controller; |
| 114 | 114 |
| 115 @override |
| 115 void syncFields(Drawer source) { | 116 void syncFields(Drawer source) { |
| 116 children = source.children; | 117 children = source.children; |
| 117 level = source.level; | 118 level = source.level; |
| 118 controller = source.controller; | 119 controller = source.controller; |
| 119 super.syncFields(source); | 120 super.syncFields(source); |
| 120 } | 121 } |
| 121 | 122 |
| 122 // TODO(mpcomplete): the animation system should handle building, maybe? Or | 123 // TODO(mpcomplete): the animation system should handle building, maybe? Or |
| 123 // at least setting the transform. Figure out how this could work for things | 124 // at least setting the transform. Figure out how this could work for things |
| 124 // like fades, slides, rotates, pinch, etc. | 125 // like fades, slides, rotates, pinch, etc. |
| 126 @override |
| 125 Widget build() { | 127 Widget build() { |
| 126 // TODO(mpcomplete): animate as a fade-in. | 128 // TODO(mpcomplete): animate as a fade-in. |
| 127 double scaler = controller.performance.progress; | 129 double scaler = controller.performance.progress; |
| 128 Color maskColor = new Color.fromARGB((0x7F * scaler).floor(), 0, 0, 0); | 130 Color maskColor = new Color.fromARGB((0x7F * scaler).floor(), 0, 0, 0); |
| 129 | 131 |
| 130 var mask = new Listener( | 132 var mask = new Listener( |
| 131 child: new Container(decoration: new BoxDecoration(backgroundColor: maskCo
lor)), | 133 child: new Container(decoration: new BoxDecoration(backgroundColor: maskCo
lor)), |
| 132 onGestureTap: controller.handleMaskTap | 134 onGestureTap: controller.handleMaskTap |
| 133 ); | 135 ); |
| 134 | 136 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 145 child: new Stack([ mask, content ]), | 147 child: new Stack([ mask, content ]), |
| 146 onPointerDown: controller.handlePointerDown, | 148 onPointerDown: controller.handlePointerDown, |
| 147 onPointerMove: controller.handlePointerMove, | 149 onPointerMove: controller.handlePointerMove, |
| 148 onPointerUp: controller.handlePointerUp, | 150 onPointerUp: controller.handlePointerUp, |
| 149 onPointerCancel: controller.handlePointerCancel, | 151 onPointerCancel: controller.handlePointerCancel, |
| 150 onGestureFlingStart: controller.handleFlingStart | 152 onGestureFlingStart: controller.handleFlingStart |
| 151 ); | 153 ); |
| 152 } | 154 } |
| 153 | 155 |
| 154 } | 156 } |
| OLD | NEW |