onClick abstract method

void onClick()

Called when the user clicks or taps on this component.

Override this method to handle click/tap interactions, such as submitting forms, toggling states, or navigating.

Implementation

void onClick();