StandardInput<T, E extends FormError> class

A standard generic input for any type T (Enums, Objects, Colors, etc) and any error type E that extends FormError.

Inheritance

Constructors

StandardInput.touched({required T value, T? initialValue, ValidationMode mode = ValidationMode.live, E? errorCache, E? remoteError})
const
StandardInput.untouched({required T value, ValidationMode mode = ValidationMode.live, E? errorCache})
const

Properties

currentRemoteError → E?
no setterinherited
detailedErrors List<E>
Returns a list of ALL validation errors for the current value.
no setterinherited
error → E?
Returns the effective error. Remote errors take precedence over local ones.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
initialValue → T
The value this input had when it was first created FormInput.untouched.
finalinherited
isNotValid bool
Returns true if there are any errors (local or remote).
no setterinherited
isPristine bool
Returns true if the value equals initialValue.
no setterinherited
isTouched bool
Returns true if the field has been touched.
no setterinherited
isUntouched bool
Returns true if the field has not been touched.
no setterinherited
isValid bool
Returns true if there are no local OR remote errors.
no setterinherited
isValidating bool
Returns true if async validation is currently running
no setterinherited
localError → E?
Returns the local validation error (cached if available).
no setterinherited
mode ValidationMode
Controls when errors are displayed (Live, Deferred, Blur).
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sanitizers List<Sanitizer<T>>
Sanitizers to transform the value before validation.
no setterinherited
status InputStatus
The interaction state (touched/untouched).
finalinherited
validators List<Validator<T, E>>
Validators to run against the value.
no setterinherited
value → T
The current value of the input.
finalinherited

Methods

displayError(FormStatus status) → E?
Resolves the error to display in the UI based on FormStatus and ValidationMode.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepareUpdate({T? value, InputStatus? status, ValidationMode? mode, E? remoteError}) InputData<T, E>
Centralizes the logic for updating a field.
inherited
sanitize(T value) → T
Define sanitization logic here (optional). Call this inside your copyWith or factories.
inherited
toString() String
A string representation of this object.
inherited
update({T? value, InputStatus? status, ValidationMode? mode, E? remoteError}) StandardInput<T, E>
override
validate(T value) → E?
Define your validation logic here. This is called automatically by the constructor.
inherited
validateAsync(T value) Future<E?>
Override to enable async validation (e.g., username availability)
inherited

Operators

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