Currently, the form does not automatically submit when the "Enter" key is pressed. The focus management is also not optimal, and there is no immediate feedback on input validation. The code for button press handlers is also not well organized, affecting readability and maintainability.
What is the new behavior?
Form Submission on Enter Key Press:
Added functionality to submit the form automatically when the "Enter" key is pressed, improving user experience.
onFieldSubmitted: (_) {
if (_isRecoveringPassword) {
_passwordRecovery();
}
}
Focus Management:
Introduced focus management to ensure the email field is focused if validation fails, guiding the user to the correct input field.
final FocusNode _emailFocusNode = FocusNode();
...
focusNode: _emailFocusNode,
Autovalidate Mode:
Enabled AutovalidateMode.onUserInteraction for email and password fields to provide immediate feedback on input validation.
What kind of change does this PR introduce?
Feature
What is the current behavior?
Currently, the form does not automatically submit when the "Enter" key is pressed. The focus management is also not optimal, and there is no immediate feedback on input validation. The code for button press handlers is also not well organized, affecting readability and maintainability.
What is the new behavior?
Form Submission on Enter Key Press:
Focus Management:
Autovalidate Mode:
AutovalidateMode.onUserInteraction
for email and password fields to provide immediate feedback on input validation.Reorganized Button Press Handlers:
_signInSignUp
and_passwordRecovery
, enhancing readability and maintainability.Code Reorganization:
Additional context
Benefits: