当我在GestureDetector中使用ListView或其他滚动时,它不起作用:
new GestureDetector(
child: new Container(
alignment: FractionalOffset.center,
child: new Text("Short Content"),
decoration: new BoxDecoration(
color: Colors.red
),
),
onVerticalDragStart: (DragStartDetails detail){
print("onVerticalDragStart");
},
onVerticalDragUpdate: (DragUpdateDetails detail){
print("onVerticalDragUpdate");
},
)
上面的用于拖动检测,但如果我在GestureDetector中有其他滚动它将无法正常工作
new GestureDetector(
child: new Container(
alignment: FractionalOffset.center,
child: new ListView(
children: <Widget>[
new Text("Long content "),
],
),
decoration: new BoxDecoration(
color: Colors.red
),
),
onVerticalDragStart: (DragStartDetails detail){
print("onVerticalDragStart");
},
onVerticalDragUpdate: (DragUpdateDetails detail){
print("onVerticalDragUpdate");
},
)