Serializer<T, U> class

Specifies a custom serializer/deserializer annotation for a field Converts between type T (the field type) and type U (the serialized type)

Constructors

Serializer({required U serialize(T value), required T deserialize(U value)})
Creates a Serializer with the given serialize and deserialize functions
const

Properties

deserialize → T Function(U value)
Function that converts from type U to type T
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serialize → U Function(T value)
Function that converts from type T to type U
final

Methods

deserializeUntyped(Object? value) Object?
Deserialize a value without requiring the caller to know U.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serializeUntyped(Object? value) Object?
Serialize a value without requiring the caller to know T.
toString() String
A string representation of this object.
inherited

Operators

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