DateTimeInputBuilder<E> class

A fluent builder that composes validators into a SimpleDateTimeInput.

All built-in shortcuts accept nullable DateTime? and return null (valid) when the value is null, letting StringValidator.required / a custom required check handle the empty case separately.

final checkIn = DateTimeInputBuilder<BookingError>()
  .required(BookingError.required)
  .after(DateTime.now(), BookingError.mustBeFuture)
  .mode(ValidationMode.blur)
  .buildUntouched();

Constructors

DateTimeInputBuilder()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

after(DateTime date, E error) DateTimeInputBuilder<E>
Fails when the value is not strictly after date. Passes (returns null) when the value is null.
before(DateTime date, E error) DateTimeInputBuilder<E>
Fails when the value is not strictly before date. Passes (returns null) when the value is null.
between(DateTime from, DateTime to, E error) DateTimeInputBuilder<E>
Fails when the value falls outside the range [from, to] (inclusive).
buildTouched({DateTime? value, E? remoteError}) SimpleDateTimeInput<E>
buildUntouched({DateTime? value}) SimpleDateTimeInput<E>
mode(ValidationMode mode) DateTimeInputBuilder<E>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onOrAfter(DateTime date, E error) DateTimeInputBuilder<E>
Fails when the value is not on or after date.
onOrBefore(DateTime date, E error) DateTimeInputBuilder<E>
Fails when the value is not on or before date.
required(E error) DateTimeInputBuilder<E>
Fails when the value is null (field is empty).
toString() String
A string representation of this object.
inherited
unless({required bool condition(), required Validator<DateTime?, E> validator}) DateTimeInputBuilder<E>
validate(Validator<DateTime?, E> validator) DateTimeInputBuilder<E>
when({required bool condition(), required Validator<DateTime?, E> validator}) DateTimeInputBuilder<E>

Operators

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