carp_serializable library

Polymorphic JSON serialization for CARP, built on json_serializable.

Serializable adds a __type property to the JSON of each object, and FromJsonFactory uses it to restore the right subclass on deserialization. Polymorphic CARP types (devices, tasks, triggers, measures, data) use this so the same JSON can be exchanged with the Kotlin CARP Core and the CARP web services.

Also re-exports Uuid from the uuid package for generating IDs.

Classes

FromJsonFactory
Registry of fromJson functions used to deserialize Serializable objects.
Serializable
Base class for objects that serialize to and from polymorphic JSON.
Uuid
uuid for Dart Author: Yulian Kuncheff Released under MIT License.

Functions

toJsonString(Object? object) → String
Converts object to an indented JSON String.

Exceptions / Errors

SerializationException
Thrown when serialization to or from JSON fails.