Remove EventDisposition
All the use cases for EventDisposition are now addressed by the gesture detection system.
This commit is contained in:
@@ -528,15 +528,11 @@ class RenderSolidColor extends RenderDecoratedSector {
|
||||
deltaTheta = constraints.constrainDeltaTheta(desiredDeltaTheta);
|
||||
}
|
||||
|
||||
EventDisposition handleEvent(sky.Event event, HitTestEntry entry) {
|
||||
if (event.type == 'pointerdown') {
|
||||
void handleEvent(sky.Event event, HitTestEntry entry) {
|
||||
if (event.type == 'pointerdown')
|
||||
decoration = new BoxDecoration(backgroundColor: const Color(0xFFFF0000));
|
||||
return EventDisposition.processed;
|
||||
} else if (event.type == 'pointerup') {
|
||||
else if (event.type == 'pointerup')
|
||||
decoration = new BoxDecoration(backgroundColor: backgroundColor);
|
||||
return EventDisposition.processed;
|
||||
}
|
||||
return EventDisposition.ignored;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,14 +42,10 @@ class RenderSolidColorBox extends RenderDecoratedBox {
|
||||
size = constraints.constrain(desiredSize);
|
||||
}
|
||||
|
||||
EventDisposition handleEvent(sky.Event event, BoxHitTestEntry entry) {
|
||||
if (event.type == 'pointerdown') {
|
||||
void handleEvent(sky.Event event, BoxHitTestEntry entry) {
|
||||
if (event.type == 'pointerdown')
|
||||
decoration = new BoxDecoration(backgroundColor: const Color(0xFFFF0000));
|
||||
return EventDisposition.processed;
|
||||
} else if (event.type == 'pointerup') {
|
||||
else if (event.type == 'pointerup')
|
||||
decoration = new BoxDecoration(backgroundColor: backgroundColor);
|
||||
return EventDisposition.processed;
|
||||
}
|
||||
return EventDisposition.ignored;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ class RenderTouchDemo extends RenderBox {
|
||||
|
||||
RenderTouchDemo();
|
||||
|
||||
EventDisposition handleEvent(sky.Event event, BoxHitTestEntry entry) {
|
||||
void handleEvent(sky.Event event, BoxHitTestEntry entry) {
|
||||
if (event is sky.PointerEvent) {
|
||||
switch (event.type) {
|
||||
case 'pointerdown':
|
||||
@@ -57,9 +57,7 @@ class RenderTouchDemo extends RenderBox {
|
||||
break;
|
||||
}
|
||||
markNeedsPaint();
|
||||
return EventDisposition.processed;
|
||||
}
|
||||
return EventDisposition.processed;
|
||||
}
|
||||
|
||||
void performLayout() {
|
||||
|
||||
Reference in New Issue
Block a user