JsonSerializable<T> mixin

An interface for reading and writing JSON.

This interface will be used when an Object needs to be read or written to JSON. These methods return a specific object and not the interface JsonSerializable. Objects implementing this interface have the ability to persist custom data to the JSON output. This custom data is stored as a Map where the keys are strings that represent properties on the Object, and the values are strings that represent the JSON value for that corresponding property. Any custom data that causes malformed JSON when the Object is persisted will not be included in the JSON output. For example, if a key from the custom data matches a property on the Object and both were written out to JSON, it would result in malformed JSON. So in this example, the key in the custom data causing the malformed JSON would not be persisted.

Mixin Applications

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
toJson() Map<String, dynamic>
Returns a JSON representation of this Object in the data type used by jsonDecode.
toJsonString() String
Returns a JSON representation of this Object as a String.
toString() String
A string representation of this object.
inherited

Operators

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