问题
How can you detect mouse wheel scroll in flutter web? It seems like it would be in a gesture detector but I don't see it in there. How do list views detect mouse scroll?
回答1:
Wrap your ListView
(or any other scroll view) with Listener and listen for PointerScrollEvent:
Listener(
onPointerSignal: (pointerSignal){
if(pointerSignal is PointerScrollEvent){
// do something when scrolled
print('Scrolled');
}
},
child: ... //your scrollview here
)
来源:https://stackoverflow.com/questions/60716259/how-to-detect-mouse-wheel-scrolling-in-flutter-web