diff --git a/packages/smooth_app/lib/pages/user_management/sign_up_page.dart b/packages/smooth_app/lib/pages/user_management/sign_up_page.dart index 6bef47d03f8..35a6b6927a2 100644 --- a/packages/smooth_app/lib/pages/user_management/sign_up_page.dart +++ b/packages/smooth_app/lib/pages/user_management/sign_up_page.dart @@ -85,16 +85,11 @@ class _SignUpPageState extends State { prefixIcon: const Icon(Icons.person), autofillHints: const [AutofillHints.email], validator: (String? value) { - final String emailTrimmed; if (value == null || value.isEmpty) { return appLocalizations.sign_up_page_email_error_empty; } - emailTrimmed = value.trim(); - if (value != emailTrimmed) { - _emailController.text = emailTrimmed; - value = emailTrimmed; - } - if (!UserManagementHelper.isEmailValid(value)) { + _emailController.text = value.trim(); + if (!UserManagementHelper.isEmailValid(value.trim())) { return appLocalizations.sign_up_page_email_error_invalid; } @@ -110,16 +105,11 @@ class _SignUpPageState extends State { prefixIcon: const Icon(Icons.person), autofillHints: const [AutofillHints.username], validator: (String? value) { - final String userTrimmed; if (value == null || value.isEmpty) { return appLocalizations.sign_up_page_username_error_empty; } - userTrimmed = value.trim(); - if (value != userTrimmed) { - _userController.text = userTrimmed; - value = userTrimmed; - } - if (!UserManagementHelper.isUsernameValid(value)) { + _userController.text = value.trim(); + if (!UserManagementHelper.isUsernameValid(value.trim())) { return appLocalizations.sign_up_page_username_description; } return null;