dart_mappable library

Classes

CaseStyle Configuration
Used to transform fields to a specific case style.
ChainedHook Mapping Hooks
A MappingHook that will chain multiple other hooks.
ClassCopyWith<Result, In, Out>
ClassCopyWithBase<Result, In extends Object, Out>
ClassMapperBase<T extends Object>
The mapper interface that all generated class mappers extend.
CopyWithBase<Result, In, Out> Copy-With
CopyWithData
DateTimeMapper Models
A mapper that encodes a DateTime object into a serializable date format and vice versa.
DecodingContext
The decoding context passed to the decoder method of a mapper.
DecodingData<T extends Object>
The decoding data passed to a class mappers instantiate method.
DecodingOptions Generics Mapper Container
Additional options to be passed to MapperContainer.fromValue.
DeltaCopyWithData
EmptyToNullHook Mapping Hooks
A MappingHook that will change an empty string to null.
EncodingContext
The encoding context passed to the encoder method of a mapper.
EncodingOptions Generics Mapper Container
Additional options to be passed to MapperContainer.toValue.
EnumMapper<T extends Enum> Custom Mappers
The mapper interface used for all concrete enum mappers.
Field<T extends Object, V>
A field defined in a class that is relevant for its mapping.
FieldCopyWithData
GenerateMethods Configuration
Collection of constants to indicate which methods and extensions to generate for a specific class.
InterfaceMapperBase<T extends Object>
The common mapper interface for class and record mappers.
IterableMapper<I extends Iterable> Custom Mappers
The default mapper for iterables like List.
ListCopyWith<Result, Elem, Copy> Copy-With
Interface used for Lists in chained copyWith methods All methods return a new modified list and do not modify the original list.
MapCopyWith<Result, Key, Value, Copy> Copy-With
Interface used for Maps in chained copyWith methods All methods return a new modified map and do not modify the original map.
MapMapper<M extends Map> Custom Mappers
The default mapper for Maps.
MappableClass Introduction Models Configuration Polymorphism Mapping Hooks Custom Mappers
Used to annotate a class in order to generate mapping code.
MappableConstructor Models Configuration
Used to annotate a constructor to be chosen as the serialization function.
MappableEnum Enums
Used to annotate an enum in order to generate mapping code.
MappableField Models Records Configuration Mapping Hooks
Used to annotate a parameter or field to overwrite the mapped key.
MappableInterface Models
Used to annotate an interface in order to generate mapping code.
MappableLib Configuration Polymorphism Generics
Used to annotate a library to define default values.
MappableRecord Records
Used to annotate a record in order to generate mapping code.
MappableValue Enums
Used to annotate an enum value in order to define a custom encoded value.
MapperBase<T extends Object> Custom Mappers
The common super class for all mappers.
MapperContainer Generics Mapper Container
The mapper container manages a set of mappers and is the main interface for accessing mapping functionalities.
MapperEquality
An Equality using a MapperContainer for its implementation.
MappingContext
The mapping context passed to all mapping methods of a mapper.
MappingHook Mapping Hooks
Extend this class to define a custom MappingHook for a class or field.
MergeCopyWithData
ObjectCopyWith<Result, In, Out> Copy-With
PrimitiveMapper<T extends Object>
The mapper implementation used for all primitive types.
RecordCopyWith<Result, T extends Record>
RecordCopyWithBase<Result, T extends Record>
RecordDeltaCopyWithData
RecordMapperBase<T extends Record>
RecordMergeCopyWithData
SerializableMapper<T extends Object, V extends Object> Migration and Compatibility
A mapper for handling classes that comply with the json_serializable format.
SetMapper<S extends Set> Custom Mappers
The default mapper for Sets.
SimpleMapper<T extends Object> Custom Mappers
An interface to define a custom mapper.
SimpleMapper1<T extends Object> Custom Mappers
An interface to define custom mappers for generic types with one argument.
SimpleMapper1Bounded<T extends Object, B1> Custom Mappers
An interface to define custom mappers for generic types with one bounded argument.
SimpleMapper2<T extends Object> Custom Mappers
An interface to define custom mappers for generic types with two arguments.
SimpleMapper2Bounded<T extends Object, B1, B2> Custom Mappers
An interface to define custom mappers for generic types with two bounded arguments.
SubClassMapperBase<T extends Object>
UnescapeNewlinesHook Mapping Hooks
A MappingHook that will unescape all escaped newline characters in a string.
UnmappedPropertiesHook Mapping Hooks
A MappingHook to get all unmapped properties in a Map.

Enums

DateTimeEncoding Models
Options for encoding a DateTime.
FieldMode
The mode of a field defined in a class.
InitializerScope Generics
The scope of mappers that should automatically be registered when using MappableClass.generateInitializerInScope.
IterableEqualityMode Custom Mappers
Options for comparing an Iterable.
MapperMethod
Method indicator used for exceptions.
MappingFlags
Collection of flags used for annotations.
TextTransform Configuration
Text transformation applied to a single word.
ValuesMode Enums
The mode used for encoding the enum values. Can be ValuesMode.named to map each enum value to its name as String or ValuesMode.indexed to map each enum value to its index as int.

Mixins

MapperEqualityMixin<T extends Object>
Overrides for mapper methods using a collection Equality.
PrimitiveMethodsMixin<T extends Object>
Overrides for mapper methods based on the primitive implementations of operator ==, hashCode and toString.

Extensions

CaseStyleTransform on CaseStyle?
MappingContextCall on O
Utility methods to call a generic function with the type argument of the mapping context.
TextTransformer on TextTransform?
TextTransformParser on TextTransform

Typedefs

ItemCopyWith<Copy, Elem, Result> = Copy Function(Elem a, Then<Elem, Result> b)
MappableFields<T extends Object> = Map<Symbol, Field<T, dynamic>>
SerializableDecoder1<T, V> = T Function<A>(V, A (Object?))
The decoding function of a serializable class (fromJson) with one generic type parameter.
SerializableDecoder2<T, V> = T Function<A, B>(V, A (Object?), B (Object?))
The decoding function of a serializable class (fromJson) with two generic type parameters.
SerializableEncoder1<T> = Object Function(Object? (dynamic)) Function(T)
The encoding function of a serializable class (toJson) with one generic type parameter.
SerializableEncoder2<T> = Object Function(Object? (dynamic), Object? (dynamic)) Function(T)
The encoding function of a serializable class (toJson) with two generic type parameters.
TypeFactory1 = Object? Function<A>(Object? f<V>())
The type factory definition for a generic type with one type argument.
TypeFactory2 = Object? Function<A, B>(Object? f<V>())
The type factory definition for a generic type with two type arguments.

Exceptions / Errors

MapperException Mapper Container
General exception class used throughout the package.