Validate extension
Validate class contains all the validation methods that are used in the application This class is used to validate the user input and return the error error if the input is invalid otherwise it returns null
- on
Methods
-
validateEmail(
{String? error}) → String? -
Validate if the email is not empty and valid
returns an error error if empty
returns null if not empty
returns null if null
error
is the custom error to be returned -
validateName(
{String? error}) → String? -
Validate if the name is not empty
returns an error error if empty
returns null if not empty
returns null if null
error
is the custom error to be returned -
validatePassword(
{String? confirmPassword, String? error, String? errorNotMatch}) → String? -
Validate if the password is not empty and valid and checks for
strong password criteria like capital, small, number, special character
returns an error error if empty
returns null if not empty
returns null if null
confirmPassword
is the password to be compared with to check if both are sameerror
is the custom error to be returned if password is emptyerrorNotMatch
is the custom error to be returned if password and confirm password doesn't match -
validateWeakPassword(
{String? confirmPassword, String? error, String? errorNotMatch}) → String? -
Validate if the password is not empty and valid but doesn't check for
strong password criteria like capital, small, number, special character
returns an error error if empty
returns null if not empty
returns null if null
error
is the custom error to be returnedconfirmPassword
is the password to be compared with to check if both are same