DraftModeEntityField<TEntity, TValue> class

Entity-aware field definition that can extract a value from a typed object.

Inheritance

Constructors

DraftModeEntityField({required String key, required TValue? readValue(TEntity entity), String? label, TValue? defaultValue, String? debugName, DraftModeValidator<TValue>? validator, List<DraftModeValidator<TValue>> validators = const [], List<TValue Function(TValue value)> valueMappers = const []})

Properties

debugName → String?
Debug-focused identifier used in logs and validation errors.
finalinherited
defaultValue → TValue?
Default value used when a runtime attribute is created from this definition.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
key → String
Stable storage and serialization key for this field.
finalinherited
label → String?
Human-readable label that consuming UIs may display for this field.
finalinherited
readValue → TValue? Function(TEntity entity)
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
validator → DraftModeValidator<TValue>?
Optional primary validator evaluated before validators.
finalinherited
validators → List<DraftModeValidator<TValue>>
Additional validators evaluated after validator.
finalinherited
valueMappers → List<TValue Function(TValue value)>
Synchronous value mappers applied before values are stored.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(TEntity entity) → TValue?
Reads this field's value from entity.
toString() → String
A string representation of this object.
inherited
validateEntity(TEntity entity, {DraftModeValidationValueContext? context}) → DraftModeValidationIssue?
Validates this field against entity and optional sibling context.
validateIssue(DraftModeValidationValueContext? context, TValue? value) → DraftModeValidationIssue?
Returns the first validation issue for value in context, if any.
inherited

Operators

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