FormBuilderValidators class
Properties
-
hashCode
→ int
-
The hash code for this object. [...]
read-only, inherited
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString()
→ String
-
Returns a string representation of this object.
inherited
Static Methods
-
creditCard({String errorText: "This field requires a valid credit card number." })
→ FormFieldValidator
-
FormFieldValidator
that requires the field's value to be a valid credit card number.
-
date({String errorText: "This field requires a valid date string." })
→ FormFieldValidator
-
FormFieldValidator
that requires the field's value to be a valid date string.
-
email({String errorText: "This field requires a valid email address." })
→ FormFieldValidator
-
FormFieldValidator
that requires the field's value to be a valid email address.
-
IP({dynamic version, String errorText: "This field requires a valid IP." })
→ FormFieldValidator
-
FormFieldValidator
that requires the field's value to be a valid IP address. [...]
-
max(num max, { String errorText })
→ FormFieldValidator
-
FormFieldValidator
that requires the field's value to be less than
or equal to the provided number.
-
maxLength(num maxLength, { String errorText })
→ FormFieldValidator
-
FormFieldValidator
that requires the length of the field's value to be
less than or equal to the provided maximum length.
-
min(num min, { String errorText })
→ FormFieldValidator
-
FormFieldValidator
that requires the field's value to be greater than
or equal to the provided number.
-
minLength(num minLength, { String errorText })
→ FormFieldValidator
-
FormFieldValidator
that requires the length of the field's value to be
greater than or equal to the provided minimum length.
-
numeric({String errorText: "Value must be numeric." })
→ FormFieldValidator
-
FormFieldValidator
that requires the field's value to be a valid number.
-
pattern(Pattern pattern, { String errorText: "Value does not match pattern." })
→ FormFieldValidator
-
FormFieldValidator
that requires the field's value to match the provided regex pattern.
-
required({String errorText: "This field cannot be empty." })
→ FormFieldValidator
-
FormFieldValidator
that requires the field have a non-empty value.
-
requiredTrue({String errorText: "This field must be set to true" })
→ FormFieldValidator
-
FormFieldValidator
that requires the field's value be true.
Commonly used for required checkboxes.
-
url({String errorText: "This field requires a valid URL address.", List<String> protocols: const ['http', 'https', 'ftp'], bool requireTld: true, bool requireProtocol: false, bool allowUnderscore: false, List<String> hostWhitelist: const [], List<String> hostBlacklist: const [] })
→ FormFieldValidator
-
FormFieldValidator
that requires the field's value to be a valid url.