FactoryFunction typedef
When decoding a JSON string, the ObjectSerialization class uses factory functions to create objects of specific types. The factory functions are provided as a map where the keys are the type names and the values are functions that create objects of that type.
For example, { 'A': A.withFinalProperties }
is a map where the key is the
type name 'A' and the value is a factory function that creates objects of
type 'A'. The factory function must take a list of final properties and
return an object of type 'A'.
The separation of final properties from transient properties allows for the deserialization of objects with circular references.
Implementation
typedef FactoryFunction = Serializable Function(List<dynamic> finalProperties);