EasyValidator class abstract

Implementers

Constructors

EasyValidator([String? errorMessage])
const
EasyValidator.compose(List<EasyValidator> validators)
Composes multiple validators into a single validator.
const
factory
EasyValidator.contains(String contains, {bool caseSensitive, String? errorMessage})
A factory constructor for creating a ContainsValidator. The contains parameter specifies the string that the value being validated should contain. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:
const
factory
EasyValidator.containsNumbers({RegExp? regExp, String? errorMessage})
A factory constructor for creating a ContainsNumbersValidator. The containsNumbers parameter specifies the string that the value being validated should contain. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:
const
factory
EasyValidator.custom(ValidatorCallback<String> validator)
A factory constructor for creating a custom validator.
const
factory
EasyValidator.email([String? errorMessage])
Creates an instance of EmailValidator with the provided errorMessage.
const
factory
EasyValidator.endWith(String endWith, {bool caseSensitive, bool useTrim, String? errorMessage})
A factory constructor for creating an EndWithValidator. The endWith parameter specifies the string that the value being validated should end with. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:
const
factory
EasyValidator.equalLength(int length, [String? errorMessage])
A factory constructor for creating an EqualLengthValidator.
const
factory
EasyValidator.equalTo(String equalTo, {bool caseSensitive, bool useTrim, String? errorMessage})
A factory constructor for creating an EqualToValidator. The equalTo parameter specifies the string that the value being validated should be equal to. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:
const
factory
EasyValidator.maxLength(int maxLength, [String? errorMessage])
A factory constructor for creating a MaxLengthValidator.
const
factory
EasyValidator.maxWordCount(int maxWordCount, [String? errorMessage])
A factory constructor for creating a MaxWordCountValidator. The maxWordCount parameter specifies the maximum number of words that the value being validated should have. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:
const
factory
EasyValidator.minLength(int minLength, [String? errorMessage])
A factory constructor for creating a MinLengthValidator.
const
factory
EasyValidator.minWordCount(int minWordCount, [String? errorMessage])
A factory constructor for creating a MinWordCountValidator. The minWordCount parameter specifies the minimum number of words that the value being validated should have. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:
const
factory
EasyValidator.notContains(String notContains, {bool caseSensitive, String? errorMessage})
A factory constructor for creating a NotContainsValidator. The notContains parameter specifies the string that the value being validated should not contain. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:
const
factory
EasyValidator.notEndWith(String notEndWith, {bool caseSensitive, bool useTrim, String? errorMessage})
A factory constructor for creating a NotEndWithValidator. The notEndWith parameter specifies the string that the value being validated should not end with. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:
const
factory
EasyValidator.notEqualLength(int length, [String? errorMessage])
A factory constructor for creating a NotEqualLengthValidator. The length parameter specifies the length that the value being validated should not have. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:
const
factory
EasyValidator.notEqualTo(String notEqualTo, {bool caseSensitive, bool useTrim, String? errorMessage})
A factory constructor for creating a NotEqualToValidator. The notEqualTo parameter specifies the string that the value being validated should not be equal to. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:
const
factory
EasyValidator.notStartWith(String notStartWith, {bool caseSensitive, bool useTrim, String? errorMessage})
A factory constructor for creating a NotStartWithValidator. The notStartWith parameter specifies the string that the value being validated should not start with. The errorMessage parameter is an optional error message to be displayed if the validation fails. Example usage:
const
factory
EasyValidator.regExp(RegExp regExp, [String? errorMessage])
A factory constructor for creating a regular expression validator.
const
factory
EasyValidator.required([String? errorMessage])
A factory constructor for creating a required validator.
const
factory
EasyValidator.startWith(String startWith, {bool caseSensitive, bool useTrim, String? errorMessage})
A factory constructor for creating a StartWithValidator.
const
factory

Properties

errorMessage String?
final
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
validate(String? value) String?
Validates the given value and returns an error message if the value is invalid.

Operators

operator ==(Object other) bool
The equality operator.
inherited