MappableClass class Introduction Models Configuration Polymorphism Mapping Hooks Custom Mappers

Used to annotate a class in order to generate mapping code.

Inheritance

Constructors

MappableClass({CaseStyle? caseStyle, bool? ignoreNull, String? uniqueId, String? discriminatorKey, dynamic discriminatorValue, MappingHook? hook, int? generateMethods, Iterable<Type>? includeSubClasses, Iterable<MapperBase<Object>>? includeCustomMappers, bool? shallowEncoding, bool? includeTypeId})
const

Properties

caseStyle → CaseStyle?
The case style for the map keys.
finalinherited
discriminatorKey → String?
Property key used for type discriminators.
final
discriminatorValue → dynamic
Custom value for the discriminator property.
final
generateMethods → int?
Specify which methods to generate for this class.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
hook → MappingHook?
Set a custom hook used only for this class.
finalinherited
ignoreNull → bool?
If true removes all map keys with null values.
finalinherited
includeCustomMappers → Iterable<MapperBase<Object>>?
Specify additional custom mappers that should be used for fields of this class.
finalinherited
includeSubClasses → Iterable<Type>?
Specify additional subclasses of this class for polymorphism.
final
includeTypeId → bool?
Whether to include the type id of the object during encoding.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shallowEncoding → bool?
Whether to encode nested objects or just one level deep.
final
uniqueId → String?
A unique id representing this class.
finalinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

useAsDefault → const MappingFlags
To be used with discriminatorValue to signal a default subclass.