feat(01-08): enhance password reset page with comprehensive error handling
- Enhanced error mapping with specific user-friendly messages - Added accessibility announcements for success and error states - Improved success message with detailed step-by-step instructions - Added resend email functionality with cooldown timer preparation - Enhanced error disposal when user starts typing - Added email validation for empty inputs - Improved PasswordResetForm widget with onEmailChanged callback - Added spam folder guidance in success instructions - Enhanced error recovery instructions for different scenarios
This commit is contained in:
@@ -9,6 +9,7 @@ class PasswordResetForm extends StatefulWidget {
|
||||
final bool isLoading;
|
||||
final String? errorMessage;
|
||||
final ValueChanged<String>? onSubmit;
|
||||
final ValueChanged<String>? onEmailChanged;
|
||||
final String emailLabel;
|
||||
final String submitButtonText;
|
||||
final bool autofocusEmail;
|
||||
@@ -22,6 +23,7 @@ class PasswordResetForm extends StatefulWidget {
|
||||
this.isLoading = false,
|
||||
this.errorMessage,
|
||||
this.onSubmit,
|
||||
this.onEmailChanged,
|
||||
this.emailLabel = 'Email',
|
||||
this.submitButtonText = 'Send Reset Email',
|
||||
this.autofocusEmail = true,
|
||||
@@ -150,6 +152,10 @@ class _PasswordResetFormState extends State<PasswordResetForm> {
|
||||
_emailError = null;
|
||||
});
|
||||
}
|
||||
// Call external callback if provided
|
||||
if (widget.onEmailChanged != null) {
|
||||
widget.onEmailChanged!(value);
|
||||
}
|
||||
},
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.deny(RegExp(r'\s')), // Prevent spaces
|
||||
|
||||
Reference in New Issue
Block a user