Move Drawer to GestureDetector

This fixes an issue in the stocks app in horizontal mode where you could both
scroll and drag the drawer at the same time.
This commit is contained in:
Adam Barth
2015-09-16 12:11:22 -07:00
parent 4c79cc2278
commit 74f7d9efee
6 changed files with 35 additions and 57 deletions

View File

@@ -53,14 +53,14 @@ void main() {
router.route(pointer.move(new Point(20.0, 20.0)));
expect(didStartPan, isTrue);
didStartPan = false;
expect(updatedScrollDelta, new sky.Offset(10.0, -10.0));
expect(updatedScrollDelta, new sky.Offset(10.0, 10.0));
updatedScrollDelta = null;
expect(didEndPan, isFalse);
expect(didTap, isFalse);
router.route(pointer.move(new Point(20.0, 25.0)));
expect(didStartPan, isFalse);
expect(updatedScrollDelta, new sky.Offset(0.0, -5.0));
expect(updatedScrollDelta, new sky.Offset(0.0, 5.0));
updatedScrollDelta = null;
expect(didEndPan, isFalse);
expect(didTap, isFalse);

View File

@@ -43,7 +43,7 @@ void main() {
Point secondLocation = new Point(10.0, 9.0);
tester.dispatchEvent(pointer.move(secondLocation), firstLocation);
expect(didStartDrag, isFalse);
expect(updatedDragDelta, 1.0);
expect(updatedDragDelta, -1.0);
updatedDragDelta = null;
expect(didEndDrag, isFalse);
@@ -86,6 +86,6 @@ void main() {
tester.dispatchEvent(pointer.up(), downLocation);
expect(gestureCount, 2);
expect(dragDistance, -20.0);
expect(dragDistance, 20.0);
});
}