Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1751)

Unified Diff: sky/framework/components/drawer.dart

Issue 1019633004: Change how events are handled in Effen (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cr changes Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/framework/components/checkbox.dart ('k') | sky/framework/components/fixed_height_scrollable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/drawer.dart
diff --git a/sky/framework/components/drawer.dart b/sky/framework/components/drawer.dart
index 731a8331e5854aa61f2c44707d015a777fc3acb3..35c147bdabaae2e6dc89b413ce9ac689848bd72e 100644
--- a/sky/framework/components/drawer.dart
+++ b/sky/framework/components/drawer.dart
@@ -115,10 +115,6 @@ class Drawer extends Component {
this.children,
this.level: 0
}) : super(key: key) {
- events.listen('pointerdown', controller.handlePointerDown);
- events.listen('pointermove', controller.handlePointerMove);
- events.listen('pointerup', controller.handlePointerUp);
- events.listen('pointercancel', controller.handlePointerCancel);
_position = new AnimatedValueListener(this, controller.position);
}
@@ -134,12 +130,15 @@ class Drawer extends Component {
String maskInlineStyle = 'opacity: ${(_position.value / _kWidth + 1) * 0.5}';
String contentInlineStyle = 'transform: translateX(${_position.value}px)';
- Container mask = new Container(
- key: 'Mask',
- style: _maskStyle,
- inlineStyle: maskInlineStyle
- )..events.listen('gesturetap', controller.handleMaskTap)
- ..events.listen('gestureflingstart', controller.handleFlingStart);
+ var mask = new EventTarget(
+ new Container(
+ key: 'Mask',
+ style: _maskStyle,
+ inlineStyle: maskInlineStyle
+ ),
+ onGestureTap: controller.handleMaskTap,
+ onGestureFlingStart: controller.handleFlingStart
+ );
Material content = new Material(
key: 'Content',
@@ -149,10 +148,16 @@ class Drawer extends Component {
level: level
);
- return new Container(
- style: _style,
- inlineStyle: inlineStyle,
- children: [ mask, content ]
+ return new EventTarget(
+ new Container(
+ style: _style,
+ inlineStyle: inlineStyle,
+ children: [ mask, content ]
+ ),
+ onPointerDown: controller.handlePointerDown,
+ onPointerMove: controller.handlePointerMove,
+ onPointerUp: controller.handlePointerUp,
+ onPointerCancel: controller.handlePointerCancel
);
}
}
« no previous file with comments | « sky/framework/components/checkbox.dart ('k') | sky/framework/components/fixed_height_scrollable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698