如何在flutter web中检测鼠标滚轮滚动?它似乎在手势检测器中,但我在那里看不到它。列表视图如何检测鼠标滚动?
用Listener包装ListView
(或任何其他滚动视图(并侦听PointerScrollEvent:
Listener(
onPointerSignal: (pointerSignal){
if(pointerSignal is PointerScrollEvent){
// do something when scrolled
print('Scrolled');
}
},
child: ... //your scrollview here
)