RequiredFieldValidator class

A validator to ensure the field is filled with any non-null and non-empty value.

Inheritance

Constructors

RequiredFieldValidator(String errorMessage)
Constructor receives the error message to be returned if the field is not filled

Properties

errorMessage String
The error message returned if the field is not filled
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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
result({required bool isValid, required String? errorMessage}) Future<ValidatorResult>
Returns a validation result as a Future to avoid verbosity
inherited
toString() String
A string representation of this object.
inherited
validate(dynamic value) Future<ValidatorResult>
Called by the FormX to validate each field.
override

Operators

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