5

I have a problem working with a listView inside a gesture detector. I am trying to execute a function based on the direction of the drag of the listView. It doesn't work, the event is not even fired, as apparently the drag event is being handled by the list view.

How do I tell the listView not to do so and ignore the drag event since, I just want my items to be under each other not actually having a list.

do I just switch to an other widget and forget the list or, is there a solution .

here is my code :

return new GestureDetector(
  child: Material(
    elevation: 12.0,
    borderRadius: widget.frontLayerBorderRadius,
    child: Stack(
      children: <Widget>[
        new ListView(
          children: <Widget>[
            widget.enableAddingInactiveAreaToPanelWhenOpened?isTopPanelVisible?InactiveAreaWidget:new Container():new Container(),
            widget.frontLayer,
          ],
        ),
        _buildInactiveLayer(context,InactiveAreaWidget),
      ],
    ),
  ),
  onVerticalDragEnd: (details) {
    print(details);
    if(details.velocity.pixelsPerSecond.dy>0.0){
      showBackLayer();
    }

  },
);
Kaki Master Of Time
  • 1,428
  • 1
  • 21
  • 39
  • this might be worth looking into https://stackoverflow.com/questions/50600747/flutter-ignore-touch-events-on-a-widget – Doc Apr 26 '19 at 03:31
  • Listener widget shall solve it https://stackoverflow.com/a/52910582/11790692 – Shalugin May 09 '23 at 22:28

0 Answers0