ComponentCodec<T> class abstract

Rules for encoding and decoding a boustro component.

Implementers

Constructors

ComponentCodec.stateful({required String typeStr, required T decode(Object?), required Object? encode(T)})
Create a codec for a component that needs to serialize state.
const
ComponentCodec.stateless({required String typeStr, required T create()})
Create a codec for a component that does not have state.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type Type
Type of the component that this codec can encode/decode.
no setter
typeStr String
String identifier used to find the codec to deserialize a component with.
final

Methods

decode(Object? value) → T
Decode the serialized state of a component to a T.
encode(T value) Object?
Encode a component's state.
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