getInputType function
Implementation
TextInputType getInputType(List<LoginType> supportedAuthMechanisms) {
// contains only email
if (supportedAuthMechanisms.contains(LoginType.EMAIL_PASSWORD) &&
!supportedAuthMechanisms.contains(LoginType.PHONE_PASSWORD) &&
!supportedAuthMechanisms.contains(LoginType.USERNAME_PASSWORD))
return TextInputType.emailAddress;
// contains only phone
if (supportedAuthMechanisms.contains(LoginType.PHONE_PASSWORD) &&
!supportedAuthMechanisms.contains(LoginType.EMAIL_PASSWORD) &&
!supportedAuthMechanisms.contains(LoginType.USERNAME_PASSWORD))
return TextInputType.phone;
// all others are intertwined; use text
return TextInputType.text;
}