I have a Row of 4 buttons, what if I want to call a different callback (or same function with different arguments) on tap on every individual button and on every combination of buttons (simultaneously pressing two or more buttons).
I have no clue.
GestureDetector
, read more about these hereYou need a method,(_handleMultiTouch) to handle all the onTapDown
,onTapUp
and onTapCancel
events.
onTapDown => _handleMultiTouch(..somebuttonId, the event)
In _handleMultiTouch(int id, var event)
is where you'll declare all the logic for handling multi touch. Here you'll save if user has tapped one or two button, or the user stopped a tap on button 1, etc. Use a switch or a if statment and save the touch states.