onTapUp method

  1. @mustCallSuper
void onTapUp(
  1. TapUpEvent event
)

Called when the user stops touching the device screen within the game canvas (and if there was an onTapDown event before).

This event is propagated to the components at the point of touch, but only if those components have received the onTapDown event previously. For those components that moved away from the point of touch, an onTapCancel will be triggered instead.

Note that if a component that was touched moves away from the point of touch, then onTapCancel will be triggered for this component only when the user stops the touch, not when the component moves away.

Implementation

@mustCallSuper
void onTapUp(TapUpEvent event) {
  event.deliverAtPoint(
    rootComponent: game,
    eventHandler: (TapCallbacks component) {
      if (_record.remove(TaggedComponent(event.pointerId, component))) {
        component.onTapUp(event);
      }
    },
    deliverToAll: true,
  );
}