Validate<T> class
final
Generates validation methods and configures field validators.
- Inheritance
-
- Object
- DeriveMeta
- DeriveTrait
- Validate
Constructors
-
Validate({bool email = false, bool url = false, Length? length, Range? range, String? contains, String? doesNotContain, String? regex, String? mustMatch, bool nested = false, FieldValidator<
T> ? custom, bool required = false, String? message}) -
Creates one validation derive marker or field-level validator config.
const
Properties
- contains → String?
-
Validates that a string field contains this pattern.
final
-
custom
→ FieldValidator<
T> ? -
Custom field validator function reference.
final
- doesNotContain → String?
-
Validates that a string field does not contain this pattern.
final
- email → bool
-
Validates that a string field uses email format.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → Length?
-
Validates string or collection length.
final
- message → String?
-
Custom message applied to validators in this annotation.
final
- mustMatch → String?
-
Validates that this field equals another field.
final
- nested → bool
-
Validates a nested object with a generated
validate()method.final - range → Range?
-
Validates numeric range.
final
- regex → String?
-
Validates that a string field matches this regular expression.
final
- required → bool
-
Fails nullable fields when the value is
null.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url → bool
-
Validates that a string field uses URL format.
final
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