private fun getPasswordFieldErrors(): PasswordInputErrors? { val validLength = InputValidator.validPasswordLength(uiState.value.password.value?:"") val validLowerUpper = InputValidator.validUpperAndLowerCase(uiState.value.password.value?:"") val validNumber = InputValidator.containsNumber(uiState.value.password.value?:"") val validSpecial = InputValidator.containSpecialCharacter(uiState.value.password.value?:"") return if (!validLength && !validLowerUpper && !validNumber && !validSpecial ) { null } else { PasswordInputErrors( validLength = validLength, validLowerUpper = validLowerUpper, validNumber = validNumber, validSpecial = validSpecial ) } }
Util function for Password field in the AccountInformation Screen This functions check for validation requirement for the password and returns error if password does not match any requirement