Skip to content

Commit a027ea1

Browse files
authored
Merge pull request #388 from Jiggy9/master
Fixes validation issue in auth screen
2 parents f43be9e + 46ab1be commit a027ea1

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Developers
44

5+
- Jigar Prajapati - <https://github.com/Jiggy9>
56
- Roland Geider – <https://github.com/rolandgeider>
67
- Dylan Aird - <https://github.com/Dolaned>
78
- Jannik Norden - <https://github.com/Jannik-dev>

lib/screens/auth_screen.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,13 @@ class _AuthCardState extends State<AuthCard> {
246246
textInputAction: TextInputAction.next,
247247
keyboardType: TextInputType.emailAddress,
248248
validator: (value) {
249+
if (value==null || value.isEmpty) {
250+
return AppLocalizations.of(context).invalidUsername;
251+
}
249252
if (!RegExp(r'^[\w.@+-]+$').hasMatch(value!)) {
250253
return AppLocalizations.of(context).usernameValidChars;
251254
}
252-
if (value.isEmpty) {
253-
return AppLocalizations.of(context).invalidUsername;
254-
}
255+
255256
return null;
256257
},
257258
inputFormatters: [FilteringTextInputFormatter.deny(RegExp(r'\s\b|\b\s'))],

0 commit comments

Comments
 (0)