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

Unified Diff: sky/framework/components/scrollable.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/radio.dart ('k') | sky/framework/fn.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/scrollable.dart
diff --git a/sky/framework/components/scrollable.dart b/sky/framework/components/scrollable.dart
index 9164898843f776324f66a1e6bc55c54cb88f9029..9d4fc6a79dd64f0de19f97fa2bea30d50f2fa867 100644
--- a/sky/framework/components/scrollable.dart
+++ b/sky/framework/components/scrollable.dart
@@ -24,14 +24,21 @@ abstract class Scrollable extends Component {
double _scrollOffset = 0.0;
Simulation _simulation;
- Scrollable({Object key, this.scrollBehavior}) : super(key: key) {
- events.listen('pointerdown', _handlePointerDown);
- events.listen('pointerup', _handlePointerUpOrCancel);
- events.listen('pointercancel', _handlePointerUpOrCancel);
- events.listen('gestureflingstart', _handleFlingStart);
- events.listen('gestureflingcancel', _handleFlingCancel);
- events.listen('gesturescrollupdate', _handleScrollUpdate);
- events.listen('wheel', _handleWheel);
+ Scrollable({Object key, this.scrollBehavior}) : super(key: key);
+
+ Node buildContent();
+
+ Node build() {
+ return new EventTarget(
+ buildContent(),
+ onPointerDown: _handlePointerDown,
+ onPointerUp: _handlePointerUpOrCancel,
+ onPointerCancel: _handlePointerUpOrCancel,
+ onGestureFlingStart: _handleFlingStart,
+ onGestureFlingCancel: _handleFlingCancel,
+ onGestureScrollUpdate: _handleScrollUpdate,
+ onWheel: _handleWheel
+ );
}
void didUnmount() {
« no previous file with comments | « sky/framework/components/radio.dart ('k') | sky/framework/fn.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698