Skip to content

Commit

Permalink
trailingSpaces issue Fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
abhay1821 committed Apr 3, 2022
1 parent 1712a5e commit 442062a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/smooth_app/lib/pages/user_management/sign_up_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,19 @@ class _SignUpPageState extends State<SignUpPage> {
prefixIcon: const Icon(Icons.person),
autofillHints: const <String>[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)) {
return appLocalizations.sign_up_page_email_error_invalid;
}

return null;
},
),
Expand All @@ -103,9 +110,15 @@ class _SignUpPageState extends State<SignUpPage> {
prefixIcon: const Icon(Icons.person),
autofillHints: const <String>[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)) {
return appLocalizations.sign_up_page_username_description;
}
Expand Down

0 comments on commit 442062a

Please sign in to comment.