NearHuscarl / flutter_login

Provides login screen with login/signup functionalities to help speed up development
MIT License
1.48k stars 788 forks source link

Username validator defaults to requiring an email even if userType is not UT.email #495

Open richardhaven opened 1 month ago

richardhaven commented 1 month ago
        widget.userValidator ?? FlutterLogin.defaultEmailValidator;

This should set specific validators based on userType (which might want an alias like userNameType)

To Reproduce Steps to reproduce the behaviour:

  1. run an app with a FlutterLogin.userType = UserType.text;
  2. enter a non-email username
  3. submit Note the error message: Invalid email!

Expected behavior appropriate validate for each value of UserType

Screenshots screenshot FlutterLogin with a non-email

Workaround Set an explicit validator