on Event
Handles events triggered in the authentication form, updating the state accordingly.
This function takes an AuthenticationFormEvent as input and performs state modifications based on the event type:
AuthenticationFormEvent.UsernameChanged: Updates the state with the new username.
AuthenticationFormEvent.EmailChanged: Updates the state with the new email.
AuthenticationFormEvent.PasswordChanged: Updates the state with the new password.
AuthenticationFormEvent.ConfirmPasswordChanged: Updates the state with the new confirm password.
AuthenticationFormEvent.RegisterClicked: Invokes the registerUser function to initiate user registration.
Parameters
event
The AuthenticationFormEvent triggering the state update.