Validators class

Constructors

Validators()

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

DirectoryName({String errorMessage = 'Invalid Directory Name', String? next(String value)?}) String? Function(String? value)?
Returns a validator that checks if a directory name is valid.
Email({String errorMessage = 'Invalid email', String? next(String value)?}) String? Function(String? value)?
Returns a validator that checks if a string is a valid email.
Equals({required String value, String errorMessage = 'Value matches to the given value', String? next(String value)?}) String? Function(String? value)?
Returns a validator that checks if a string equals to given string. It can be used in specific cases like password confirmation.
FileName({String errorMessage = 'Invalid File Name', String? next(String value)?, List<String>? extensionWhereIn}) String? Function(String? value)?
Returns a validator that checks if a file name is valid.
LengthBetween(int min, int max, {String errorMessage = 'Field Should be atleast *min_len* and at most *max_len* characters long', String? next(String value)?}) String? Function(String? value)?
Returns a validator that checks if a string's length lies between the values provided
MaxLength({required int length, String errorMessage = 'Maximum length is *max_len*', String? next(String value)?}) String? Function(String? value)?
Returns a validator that checks if a string is at most a certain length.
MinLength({required int length, String errorMessage = 'Minimum length is *min_len*', String? next(String value)?}) String? Function(String? value)?
Returns a validator that checks if a string is at least a certain length.
Number({String errorMessage = 'Invalid number', String? next(String value)?, bool integerOnly = false, bool allowNegative = true, bool allowDecimal = true}) String? Function(String? value)?
Returns a validator that checks if a string is a valid number.
Regex({required String pattern, String errorMessage = 'Invalid value', String? next(String value)?}) String? Function(String? value)?
Returns a validator that checks if a string is matches given regex pattern.
Required({String errorMessage = 'Field cannot be empty', String? next(String value)?}) String? Function(String? value)?
Returns a validator that checks if a string is empty.
Url({String errorMessage = 'Invalid url', String? next(String value)?}) String? Function(String? value)?
Returns a validator that checks if a string is a valid url.