Validators class abstract final

Commonly used PrismValidators, composable via Validators.all.

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

all(List<PrismValidator> validators) → PrismValidator
Combines validators; the first failing message wins.
email([String message = 'Enter a valid email address']) → PrismValidator
Fails when the value is not a plausible email address.
maxLength(int max, [String? message]) → PrismValidator
Fails when the value is longer than max characters.
minLength(int min, [String? message]) → PrismValidator
Fails when the value is shorter than min characters.
number([String message = 'Enter a valid number']) → PrismValidator
Fails when the value is not a number.
pattern(RegExp pattern, [String? message]) → PrismValidator
Fails when the value does not match pattern.
required([String message = 'This field is required']) → PrismValidator
Fails when the value is null or blank.