Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/screens/auth_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ class _AuthCardState extends State<AuthCard> {
}
return null;
},
inputFormatters: [FilteringTextInputFormatter.deny(new RegExp(r"\s\b|\b\s"))],
onSaved: (value) {
_authData['username'] = value!;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it would be better to just trim the whitespaces when saving to _authdata?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes It would be better , but What happens is when we enter a whitespace the regexp catches it and throws an error, Normal People will be frustrated by seeing an Error, It spoils our User Experience, So what we do as a developer is we ignore those mistakes made by the users, That is what most important in UX, So inorder to improve our UX(User Experience) we must ignore the mistake and not throw an error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I meant instead of the regex, there might be some corner cases where the user only enters white spaces or somthing like that but we can probably live with that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is a valid PR and I get a hactober-accepted label ;)

},
Expand Down