Skip to content

Commit

Permalink
Merge pull request #127 from SamarpanCoder2002/Samarpan2
Browse files Browse the repository at this point in the history
Proper Age Validation Added in Sign-up form additional Details
  • Loading branch information
avinashkranjan committed Mar 31, 2021
2 parents 016806c + a3da860 commit 8720e7f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/widgets/signup_form_additional_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,15 @@ class _SignUpFormAdditionalDetailsState
SizedBox(width: 20),
Flexible(
child: AuthInputField(
textInputType: TextInputType.number,
labelText: "Age",
controller: _age,
textInputAction: TextInputAction.next,
validator: (_) {
if (_course.isNotEmpty) {
return null;
}
return "Enter valid Course Name";
validator: (age) {
if (age.isNotEmpty &&
age.length == 2 &&
int.parse(age) >= 16) return null;
return "Enter Valid Age";
},
suffixIcon:
Icon(Icons.menu_book, color: Colors.white),
Expand Down

0 comments on commit 8720e7f

Please sign in to comment.