BlocxSingleErrorFieldValidator<T> class
abstract
A base class for field validators that produce at most a single error message.
This class is intended for simple validation scenarios where each field can only produce one error. It wraps the result of validateWithSingleError into a list so it is compatible with the multi-error API of BlocxFieldValidator.
Subclasses must implement validateWithSingleError to define the actual validation logic.
Subclasses should NOT override validate, as it is internally used to
convert a single error into a list of errors.
- Inheritance
-
- Object
- BlocxFieldValidator<
T> - BlocxSingleErrorFieldValidator
- Implementers
- BlocxConditionalRequiredValidator
- BlocxDateRangeValidator
- BlocxExactLengthValidator
- BlocxLengthRangeValidator
- BlocxMatchFieldValidator
- BlocxMaxDateValidator
- BlocxMaxLengthValidator
- BlocxMaxValueValidator
- BlocxMinDateValidator
- BlocxMinLengthValidator
- BlocxMinValueValidator
- BlocxRangeValueValidator
- BlocxRegexValidator
- BlocxRequiredValidator
Constructors
- BlocxSingleErrorFieldValidator({Duration? duration})
- Constructs a new instance of BlocxSingleErrorFieldValidator.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validateWithSingleError(
T value) → String? -
Validates the given
valueand returns a single error message if invalid.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited