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 here You 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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.