Password requirement validation added

This commit is contained in:
2024-08-02 10:47:08 +02:00
parent 66e35cf8c8
commit 04f1b31fb2
2 changed files with 37 additions and 4 deletions

View File

@@ -39,8 +39,7 @@ class _MyTextFieldState extends State<MyTextField> {
return null;
} else if (text.isEmpty) {
return "${widget.hintText} is required";
} else if (widget.hintText == "Email" &&
!isEmailValid(widget.controller.text)) {
} else if (widget.hintText == "Email" && !isEmailValid(text)) {
return "Enter a valid email address";
}
return null;