ValidatorBuilder class
A fluent validation builder that supports both validation and schema generation
Constructors
- ValidatorBuilder([String? _prefix])
Properties
Methods
-
boolean(
String field, bool? value, {bool required = false, bool? mustBe}) → ValidatorBuilder - Boolean field validation
-
build(
) → ValidationResult - Build the final validation result
-
custom(
String field, bool validator(), String errorMessage) → ValidatorBuilder - Custom validation
-
dateTime(
String field, DateTime? value, {bool required = false, bool pastOrPresent = false, DateTime? after, DateTime? before}) → ValidatorBuilder - DateTime field validation
-
email(
String field, String? value, {bool required = false}) → ValidatorBuilder - Email validation convenience method
-
entityId(
String field, String? value, String prefix, {bool required = false}) → ValidatorBuilder - Entity ID validation convenience method
-
enumField<
T> (String field, T? value, {bool required = false, required List< T> options}) → ValidatorBuilder - Enum field validation
-
integer(
String field, int? value, {bool required = false, int? min, int? max}) → ValidatorBuilder - Integer field validation
-
list<
T> (String field, List< T> ? value, {bool required = false, int? minItems, int? maxItems, String itemType = 'string', bool allowEmpty = true}) → ValidatorBuilder - List field validation
-
money(
String field, dynamic value, {bool required = false, bool nonNegative = false}) → ValidatorBuilder - Money validation (assumes Money class with cents property)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notNull<
T> (String field, T? value, {bool required = false}) → ValidatorBuilder - Generic not-null validation for any type
-
number(
String field, num? value, {bool required = false, num? min, num? max}) → ValidatorBuilder - Number field validation
-
object(
String field, Map< String, dynamic> ? value, {bool required = false, required ValidationResult validator(ValidatorBuilder)}) → ValidatorBuilder - Nested object validation
-
string(
String field, String? value, {bool required = false, int? minLength, int? maxLength, String? pattern}) → ValidatorBuilder - String field validation
-
toString(
) → String -
A string representation of this object.
inherited
-
uuid(
String field, String? value, {bool required = false}) → ValidatorBuilder - UUID validation convenience method
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited