read method
Reads all field keys and values from the specified attributes
map.
This method is called after the de-serialization.
Note: if you have complex fields such as nested objects, non generic lists or maps, you need to implement
both Serializable
and OnDemandSerializable
, extend SerializableObject
and implement OnDemandSerializable
,
or specify the corresponding transformers
and objectCreators
in the Serializer
on demand methods.
Compare Serializer.serializeOnDemand()
and Serializer.deserializeOnDemand()
methods.
name = attributes['name'];
price = attributes['price'];
Implementation
@override
void read(Map<String, dynamic> attributes) {
personalName = attributes['personalName'];
email = attributes['email'];
}