ObjectSerialization class
This class that provides static methods to encode and decode objects to and from JSON strings.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
decode(
String buffer, Map< String, FactoryFunction> ? factories) → dynamic - decode takes a JSON string and a map of factory functions and returns the object that was encoded in the JSON string. The factory functions are used 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.
-
encode(
dynamic object) → String - encode takes an object and returns a JSON string representation of that object. The object can be a simple object, a list, a set, or an object that implements Serializable. The object can contain circular references.