onClick method
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
@override
void onClick() {
checked = !checked;
}