FormBuilderValidators class

Taken from flutter_form_builder project - a version conflict prevented us using it

Constructors

FormBuilderValidators()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
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(String 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.