I have a ListView
widget with a bunch of other widgets within it.
One of the widgets within the ListView
wishes to handle mouse wheel events (PointerScrollEvent
).
My issue is, that whenever I hover over the contained widget and use the mouse wheel, the both the ListView
and the contained element react to the mouse wheel.
How can I prevent the PointerScrollEvent
from being handled by the ListView
in cases where it is handled by one of its child elements?
...
return ListView(
children: [
Listener(
behavior: HitTestBehavior.opaque,
onPointerSignal: (event) {
if (event is PointerScrollEvent) {
print('scrolling ${event.scrollDelta.dy}');
}
},
child: Container(
color: Coors.green,
height: 250,
child: const Text('tap me'),
),
...