Validator class

Constructors

Validator({List<String? Function(String?)> callbacks = const []})
const

Properties

callbacks List<String? Function(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

add(String? callback(String?)) Validator
Returns a copy of this Validator, with callback added to the end of its callbacks.
call(String? value) String?
contains(String string, {String message = "Validator.contains"}) Validator
Returns a Validator that accepts a value that contains a match of string.
copy() Validator
Returns a copy of this Validator.
equals(TextEditingController controller, {String message = "Validator.equals"}) Validator
Returns a Validator that accepts a value that is equal to the controller's text.
hasNoWhitespace({String message = "Validator.hasNoWhitespace"}) Validator
Returns a Validator that accepts a value that contains no whitespace characters.
hasWhitespace({String message = "Validator.hasWhitespace"}) Validator
Returns a Validator that accepts a value containing at least one whitespace character.
isAlphabetical({String message = "Validator.isAlphabetical"}) Validator
Returns a Validator that accepts a value that is comprised of only letters, or empty.
isAlphanumerical({String message = "Validator.isAlphanumerical"}) Validator
Returns a Validator that accepts a value that is comprised of only letters and numbers, or empty.
isLowerCase({String message = "Validator.isLowerCase"}) Validator
Returns a Validator that accepts a value where all letters are lower-case.
isNotEmpty({String message = "Validator.isNotEmpty"}) Validator
Returns a Validator that accepts a value that is not null or empty.
isNumerical({String message = "Validator.isNumerical"}) Validator
Returns a Validator that accepts a value that is comprised of only numbers, or empty.
isUpperCase({String message = "Validator.isUpperCase"}) Validator
Returns a Validator that accepts a value where all letters are upper-case.
matches(RegExp regExp, {String message = "Validator.matches"}) Validator
Returns a Validator that accepts a value that has a match in regExp.
maxLength(int length, {bool trim = false, String message = "Validator.maxLength"}) Validator
Returns a Validator that accepts a value that is shorter or of equal length to length.
minLength(int length, {bool trim = false, String message = "Validator.minLength"}) Validator
Returns a Validator that accepts a value that is longer or of equal length to length.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notEquals(TextEditingController controller, {String message = "Validator.notEquals"}) Validator
Returns a Validator that accepts a value that is not equal to the controller's text.
toString() String
A string representation of this object.
inherited

Operators

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