SerializerRepo class

Repository that contains Serializer for a Type.

Example:

SerializerRepo repository = new SerializerRepo();
respository.add(new UserSerializer());

User user = new User();

// serialize
Map<String, dynamic> map = repository.serialize(user);
List<Map<String,dynamic>> list = repository.serialize([ user ] );

// deserialize
user = repository.deserialize(map, type: User);
List<User> users = repository.deserialize(list, type: User);
Implementers

Constructors

SerializerRepo()

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

from<T>(dynamic object) → dynamic
Deserializes Dart built-in object to Dart PODO
getByType<T>(Type type) Serializer<T>
Return a Serializer for a Type
listFrom<T>(List object) → List<T>
Deserializes object (List<dynamic>) to List<T>
mapFrom<T>(Map<String, dynamic> object) → Map<String, T>
oneFrom<T>(dynamic object) → T
Deserializes object to T
to(dynamic object) → dynamic
Serializes object to Dart built-in type
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

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