FormValidator class

Constructors

FormValidator(FormValidator? prev, FormValidator? next, ValidationFn? validator)
FormValidator.builder()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
next FormValidator?
getter/setter pair
prev FormValidator?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
validator ValidationFn?
getter/setter pair

Methods

build() ValidationFn
Used to merge all links of the chain into a final function of type ValidationFn
custom(ValidationFn fn) FormValidator
The below functions are provided to allow for extension of the base validation functionality. Allows for a custom function to be added into the chaining sequence
inList(List<String> list, {String? errorMessage}) FormValidator
Adds StraingValidationFunctions.inList to the function validation chain
isAnEmail({String? errorMessage}) FormValidator
Adds StraingValidationFunctions.isAnEmail to the function validation chain
isDateTime({String? errorMessage, String dateFormat = "dd/MM/yyyy", bool parseLoose = false}) FormValidator
Adds StraingValidationFunctions.isDateTime to the function validation chain
isEqualTo(String equals, {String? errorMessage}) FormValidator
Adds StraingValidationFunctions.equals to the function validation chain
isNumeric({String? errorMessage}) FormValidator
Adds StraingValidationFunctions.isNumeric to the function validation chain
lengthEq(int length, {String? errorMessage}) FormValidator
Adds StraingValidationFunctions.lengthEq to the function validation chain
lengthGt(int length, {String? errorMessage}) FormValidator
Adds StraingValidationFunctions.lengthGt to the function validation chain
lengthGtEq(int length, {String? errorMessage}) FormValidator
Adds StraingValidationFunctions.lengthGtEq to the function validation chain
lengthLt(int length, {String? errorMessage}) FormValidator
Adds StraingValidationFunctions.lengthLt to the function validation chain
lengthLtEq(int length, {String? errorMessage}) FormValidator
Adds StraingValidationFunctions.lengthLtEq to the function validation chain
matches(String pattern, {String? errorMessage}) FormValidator
Adds StraingValidationFunctions.matches to the function validation chain
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notEmpty({String? errorMessage}) FormValidator
Adds StraingValidationFunctions.notEmpty to the function validation chain
notEqualTo(String equals, {String? errorMessage}) FormValidator
Adds StraingValidationFunctions.notEquals to the function validation chain
notInList(List<String> list, {String? errorMessage}) FormValidator
Adds StraingValidationFunctions.notInList to the function validation chain
notNull({String? errorMessage}) FormValidator
Adds StraingValidationFunctions.notNull to the function validation chain
required({String? nullError, String? emptyError}) FormValidator
Below are base case validatior functions, they are provided to cover most basic use cases that might be encountered.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

mergeFNs(ValidationFn a, ValidationFn b) ValidationFn
Merges two functions of type ValidationFn into one function of type ValidationFn