1

I have a widget inside the Scaffold, for example, Container, whose child is Listview. The builder of Listview returns Dismissible, with the removal of selected item on swipe. If you simultaneously select 2 or more items of the Listview and swipe them, they will both be removed. Is it possible to avoid deleting several selected items? Or, alternatively, do not handle the second touch on the screen.

PS. I described the solution here.

Igor Gor
  • 391
  • 4
  • 8
  • Try to wrap your widget inside a gestureDetector and override the gestures to perform nothing. – Jaswant Singh Apr 18 '19 at 09:13
  • @JaswantSingh unfortunately gestureDetector does not have any handler to handle multiple touches, and if to create a counter that counts number of pointers that are currently on the screen, and makes Dismissible widgets unavailable (except from currently selected), it does not work for simultaneous touches. – Igor Gor Apr 18 '19 at 13:31

1 Answers1

3

You can use the OneSequenceGestureRecognizer class OneSequenceGestureRecognizer documentation.

There's a SO thread where you can see some sample code too sample code.

Roberto Manfreda
  • 2,345
  • 3
  • 25
  • 39