BuildContext class

A base context for building serializable classes.

Constructors

BuildContext(ConstantReader annotation, InterfaceElement clazz, {String? originalClassName, String? sourceFilename, bool autoSnakeCaseNames = true, bool autoIdAndDateFields = true, List<DartObject> includeAnnotations = const <DartObject>[]})

Properties

aliases Map<String, String>
A map of field names to resolved names from @Alias() declarations.
final
annotation → ConstantReader
final
autoIdAndDateFields bool
final
autoSnakeCaseNames bool
final
clazz → InterfaceElement
final
constructorParameters List<ParameterElement>
final
defaults Map<String, DartObject>
A map of field names to their default values.
final
excluded Map<String, Exclude>
A map of fields that have been marked as to be excluded from serialization.
final
fieldInfo Map<String, SerializableFieldMirror>
A map of fields to their related information.
final
fields List<FieldElement>
The fields declared on the original class.
final
hashCode int
The hash code for this object.
no setterinherited
importsPackageMeta bool
no setter
includeAnnotations List<DartObject>
Any annotations to include in the generated class.
final
modelClassName String?
The name of the generated class.
no setter
modelClassNameRecase → ReCase
A ReCase instance reflecting on the modelClassName.
no setter
modelClassType → TypeReference
no setter
originalClassName String?
final
primaryKeyField → FieldElement
The FieldElement pointing to the primary key.
no setter
primaryKeyName String
The name of the field that identifies data of this model type.
getter/setter pair
requiredFields Map<String, String>
A map of fields that are absolutely required, and error messages for when they are absent.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shimmed Map<String, bool>
A map of "synthetic" fields, i.e. id and created_at injected automatically.
final
sourceFilename String?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveFieldName(String name) String?
Get the aliased name (if one is defined) for a field.
resolveSerializedFieldType(String name) → DartType
Finds the type that the field name should serialize to.
toString() String
A string representation of this object.
inherited

Operators

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