FieldSerializable class

Interface for other field-level annotations. For example, class Rest extends FieldSerializable {}

Constructors

FieldSerializable()

Properties

defaultValue String
The value to use if the source's value is null. This is often directly injected to the adapter, and wrapping is required for strings. (e.g. defaultValue: "'Missing Last Name'") [...]
read-only
fromGenerator String
Manipulates output for the field in the deserialize generator. The instance's field name is automatically defined. While the build method is ultimately responsible for how the output is applied, it is most often directly injected as the value of the field in the deserialize adapter. [...]
read-only
ignore bool
true if the generator should ignore this field completely.
read-only
name String
The key name to use when reading and writing values corresponding to the annotated field.
read-only
nullable bool
When true, null fields are handled gracefully when serializing and deserializing.
read-only
toGenerator String
Manipulates output for the field in the serialize generator. The serializing key is defined from name or the default naming of the field. While the build method is ultimately responsible for how the output is applied, it is most often directly injected as the value of the field in the serialize adapter. [...]
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited

Constants

ANNOTATED_NAME_VARIABLE → const String
Placeholder. Replaces with name (e.g. @Rest(name:) or @Sqlite(name:)). Defaults to field name after any applicable renaming transforms.
'%ANNOTATED_NAME%'
DATA_PROPERTY_VARIABLE → const String
Placeholder. Replaces with data['annotated_name'] per @Rest(name:) or @Sqlite(name:). Only valuable for from generators.
'%DATA_PROPERTY%'
INSTANCE_PROPERTY_VARIABLE → const String
Placeholder. Replaces with field name (instance.myField in final String myField). Only valuable for to generators.
'%INSTANCE_PROPERTY%'