dorm_annotations
library
Classes
$CopyWithPlaceholder
Placeholder used as the default value for parameters in generated methods.
It lets the generator distinguish between an explicitly passed null and
an omitted parameter, ensuring both nullable and non-nullable fields keep
their existing values when not updated.
CopyWith
Annotation used to indicate that the copyWith extension should be generated for the given class.
CopyWithField
Field related options for the class's CopyWith annotation.
Data
Allows a class to be serialized.
DatabaseGeneratedIdSpec
Describes a primary-key field generated by the database or remote backend.
DerivedField
Defines a persisted value produced by a derived-field callback.
DerivedTransformations
Common transformations available to derived-field callbacks.
ExistingIdSpec
Describes a primary-key field already declared by the annotated class.
Field
Links a database column to a Dart field within a model class.
ForeignField
Links a database foreign key to a Dart field within a model class.
GeneratedIdSpec
Describes a primary-key field generated by dORM.
IdSpec
Describes one part of a model's primary key.
JsonConverter <T , S >
Implement this class to provide custom converters for a specific Type .
JsonEnum
Allows configuration of how enum elements are treated as JSON.
JsonKey
An annotation used to specify how a field is serialized.
JsonLiteral
An annotation used to generate a private field containing the contents of a
JSON file.
JsonSerializable
An annotation used to specify a class to generate code for.
JsonValue
An annotation used to specify how a enum value is serialized.
Model
Links a database table to a Dart class.
ModelField
Links a database composite column to a Dart field within a model class.
ModelFieldTemplate <T >
ModelFieldType
PolymorphicData
Associates a composite object to a PolymorphicField .
PolymorphicField
Links a database composite column and a pivot column to a Dart field within
a model class.
Functions
$checkedConvert <T > (Map map , String key , T castFunc (dynamic ), {Object ? readValue (Map , String )? })
→ T
Helper function used in generated code when
JsonSerializableGenerator.checked is true.
$checkedCreate <T > (String className , Map map , T constructor (S <S >(String , S (Object ? ), {Object ? readValue (Map , String )? }) ), {Map <String , String > fieldKeyMap = const {} })
→ T
Helper function used in generated code when
JsonSerializableGenerator.checked is true.
$checkedNew <T > (String className , Map map , T constructor (), {Map <String , String > ? fieldKeyMap })
→ T
Helper function used in generated code when
JsonSerializableGenerator.checked is true.
$checkKeys (Map map , {List <String > ? allowedKeys , List <String > ? requiredKeys , List <String > ? disallowNullValues })
→ void
Helper function used in generated fromJson code when
JsonSerializable.disallowUnrecognizedKeys is true for an annotated type or
JsonKey.required is true for any annotated fields.
$enumDecode <K extends Enum , V > (Map <K , V > enumValues , Object ? source , {K? unknownValue })
→ K
Returns the key associated with value source from enumValues, if one
exists.
$enumDecodeNullable <K extends Enum , V > (Map <K , V > enumValues , Object ? source , {Enum ? unknownValue })
→ K?
Returns the key associated with value source from enumValues, if one
exists.
$normalizeDate (DateTime ? value )
→ String ?
Formats a value as "YYYYMMDD".
$normalizeDateTime (DateTime ? value )
→ String ?
Formats a value as "YYYYMMDDHHmmssSSS".
$normalizeEnum (Object ? value )
→ String ?
Removes the Class. component of a value string-formatted as Class.value.
$normalizeText (String ? value )
→ String ?
Removes spaces, replace diacritics and capitalization for a value.
Exceptions / Errors
BadKeyException
A base class for exceptions thrown when decoding JSON.
CheckedFromJsonException
Exception thrown if there is a runtime exception in fromJson
code generated when JsonSerializableGenerator.checked is true
DisallowedNullValueException
Exception thrown if there are keys with disallowed null values in a JSON
map that was provided during deserialization.
MissingRequiredKeysException
Exception thrown if there are missing required keys in a JSON map that was
provided during deserialization.
UnrecognizedKeysException
Exception thrown if there are unrecognized keys in a JSON map that was
provided during deserialization.
dorm_annotations 2.0.0-dev.5