Validators class

A collection of reusable validators for form fields.

Use Validators.compose to combine multiple validators.

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

compose(List<String? Function(dynamic)> validators) String? Function(dynamic)
email({String message = "Invalid email"}) String? Function(dynamic)
match(String otherValueGetter(), {String message = "Values do not match"}) String? Function(dynamic)
minLength(int length, {String? message}) String? Function(dynamic)
numeric({String message = "Must be a number"}) String? Function(dynamic)
passwordStrong({String message = "Password too weak"}) String? Function(dynamic)
phone({String message = "Invalid phone number"}) String? Function(dynamic)
range(num min, num max, {String? message}) String? Function(dynamic)
required({String message = "Required"}) String? Function(dynamic)