Flutter 如何在手势检测器中检测刷起?
我知道对于向下滑动检测有Flutter 如何在手势检测器中检测刷起?,flutter,dart,flutter-layout,flutter-dependencies,flutter-animation,Flutter,Dart,Flutter Layout,Flutter Dependencies,Flutter Animation,我知道对于向下滑动检测有onVerticalDragDown,但是对于向上滑动检测,在gesturedector小部件中没有onVerticalDragUp参数。您正在寻找gesturedector类中的onPanUpdate方法 GestureDetector(onPanUpdate: (details) { if (details.delta.dx > 0) print("Dragging in +X direction"); else print("Dragg
onVerticalDragDown
,但是对于向上滑动检测,在gesturedector
小部件中没有onVerticalDragUp
参数。您正在寻找gesturedector类中的onPanUpdate方法
GestureDetector(onPanUpdate: (details) {
if (details.delta.dx > 0)
print("Dragging in +X direction");
else
print("Dragging in -X direction");
if (details.delta.dy > 0)
print("Dragging in +Y direction");
else
print("Dragging in -Y direction");
});
注意:不要将此方法用于已在使用的(onVerticalDragDown)或onVerticalDragUpdate()。请检查以下内容: