ZDate class abstract interface

Inheritance
Implementers

Properties

checks List<Map<String, dynamic>>
Unmodifiable view of the constraint metadata recorded via addCheck. Empty for schemas built without constraints, or for constraints not yet annotated (which simply don't appear in the exported schema).
no setterinherited
description String?
The description set via describe, or null.
no setterinherited
exampleValue Object?
The example set via example (only meaningful when hasExample).
no setterinherited
hasExample bool
Whether an example was set via example.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isNullable bool
no setterinherited
isOptional bool
no setterinherited
isOptionalLike bool
🔥 MUITO IMPORTANTE
no setterinherited
issues List<ZardIssue>
The issues accumulated during the most-recent parse call. Mutable so containers (ZMap, ZList) can do issues.addAll(...).
no setterinherited
issuesInternal List<ZardIssue>
Direct access to the parse context's issues list — internal use only.
no setterinherited
message String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transformsInternal List<Transformer<DateTime>>
no setterinherited
validatorsInternal List<Validator<DateTime>>
Non-allocating raw lists. Library-internal use only — never expose these to consumers because they bypass the unmodifiable contract. Used by specialized schema implementations (ZInt, ZDouble, etc.) to avoid creating an List.unmodifiable wrapper per parse() call.
no setterinherited

Methods

$default(DateTime defaultValue) Schema<DateTime>
A schema to define a default value for a field.
inherited
addCheck(String check, [Object? value]) → void
Records introspectable metadata about a constraint as it is applied, so the schema can be exported to JSON Schema / OpenAPI without executing it. Builder methods (.min/.max/.email/.regex/...) call this alongside addValidator. By convention check is the target JSON Schema keyword (e.g. 'minLength', 'pattern', 'format') and value its value, so a converter can map an entry to node[check] = value directly.
inherited
addError(ZardIssue error) → void
inherited
addTransform(Transformer<DateTime> transform) → void
inherited
addValidator(Validator<DateTime> validator) → void
inherited
clearErrors() → void
Resets the current parse context. Called at the start of every parse(). Uses List.clear in-place to avoid allocating a fresh context per call.
inherited
datetime() ZDate
Adds a validator that checks for a valid datetime format.
describe(String description) Schema<DateTime>
Attaches a human-readable description to this schema, emitted into the exported JSON Schema / OpenAPI. Purely documentational — it does not affect validation. Chainable; call it after constraints: z.string().min(1).describe('Full name').
inherited
example(Object? value) Schema<DateTime>
Attaches an example value, emitted into the exported schema. Like describe, it is documentation-only and does not affect validation.
inherited
getErrors() List<ZardIssue>
inherited
getTransforms() List<Transformer<DateTime>>
inherited
getValidators() List<Validator<DateTime>>
Public, backward-compatible accessor — returns an unmodifiable view. Internal hot paths should iterate validatorsInternal / transformsInternal directly.
inherited
list({String? message}) ZList
inherited
markRequired() Schema
Marks this schema as required (removes optional flag).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nullable() Schema<DateTime?>
inherited
nullish() Schema<DateTime?>
inherited
optional() Schema<DateTime?>
inherited
parse(dynamic value, {String path = ''}) DateTime
override
parseAsync(dynamic value, {String path = ''}) Future<DateTime>
inherited
parseInto(dynamic value, String path, List<ZardIssue> sink) DateTime?
Internal entry point used by container schemas (ZMap, ZList, ZUnion, ZInterface, etc.) to avoid the per-field/per-item try/catch overhead of public parse. On success returns the parsed value and leaves sink unchanged. On failure appends at least one issue to sink (callers determine success by comparing sink.length before/after).
inherited
refine(bool predicate(DateTime value), {String? message, String? path}) Schema<DateTime>
inherited
safeParse(dynamic value, {String path = ''}) ZardResult<DateTime>
inherited
safeParseAsync(dynamic value, {String path = ''}) Future<ZardResult<DateTime>>
inherited
toString() String
A string representation of this object.
inherited
transform<R>(R transformer(DateTime value)) → TransformedSchema<DateTime, R>
inherited
transformTyped<R>(R transformer(DateTime value)) → TransformedSchema<DateTime, R>
inherited

Operators

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