DraftModeFieldDefinition<T> class

Reusable field definition that keeps field-level metadata in one place.

Definitions are stable descriptors: they own identifiers, defaults, debug labels, validators, and value mappers, but never the mutable runtime value of a concrete form instance.

Implementers

Constructors

DraftModeFieldDefinition({required String key, String? label, T? defaultValue, String? debugName, DraftModeValidator<T>? validator, List<DraftModeValidator<T>> validators = const [], List<T Function(T value)> valueMappers = const []})

Properties

debugName String?
Debug-focused identifier used in logs and validation errors.
final
defaultValue → T?
Default value used when a runtime attribute is created from this definition.
final
hashCode int
The hash code for this object.
no setterinherited
key String
Stable storage and serialization key for this field.
final
label String?
Human-readable label that consuming UIs may display for this field.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
validator DraftModeValidator<T>?
Optional primary validator evaluated before validators.
final
validators List<DraftModeValidator<T>>
Additional validators evaluated after validator.
final
valueMappers List<T Function(T value)>
Synchronous value mappers applied before values are stored.
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
validateIssue(DraftModeValidationValueContext? context, T? value) DraftModeValidationIssue?
Returns the first validation issue for value in context, if any.

Operators

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