Fold fling gesture into onDragEnd
That way the fling engages in the same direction as the scroll. For example, if you have a horizontal scroll nested inside a vertical scroll, the fling will take place in the same direction as the scroll.
This commit is contained in:
@@ -25,7 +25,7 @@ void main() {
|
||||
};
|
||||
|
||||
bool didEndPan = false;
|
||||
pan.onEnd = () {
|
||||
pan.onEnd = (sky.Offset velocity) {
|
||||
didEndPan = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ void main() {
|
||||
onVerticalDragUpdate: (double scrollDelta) {
|
||||
updatedDragDelta = scrollDelta;
|
||||
},
|
||||
onVerticalDragEnd: () {
|
||||
onVerticalDragEnd: (Offset velocity) {
|
||||
didEndDrag = true;
|
||||
},
|
||||
child: new Container()
|
||||
@@ -69,9 +69,9 @@ void main() {
|
||||
Widget builder() {
|
||||
return new GestureDetector(
|
||||
onVerticalDragUpdate: (double delta) { dragDistance += delta; },
|
||||
onVerticalDragEnd: () { gestureCount += 1; },
|
||||
onVerticalDragEnd: (Offset velocity) { gestureCount += 1; },
|
||||
onHorizontalDragUpdate: (_) { fail("gesture should not match"); },
|
||||
onHorizontalDragEnd: () { fail("gesture should not match"); },
|
||||
onHorizontalDragEnd: (Offset velocity) { fail("gesture should not match"); },
|
||||
child: new Container()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user