ApiCacheCodec<T> class

Turns an answer into text that can be saved, and back.

Constructors

ApiCacheCodec({required String encode(T value), required T decode(String data)})
const

Properties

decode → T Function(String data)
final
encode → String Function(T value)
final
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 Properties

text → ApiCacheCodec<String>
For answers that are text already, saved exactly as received.
final

Static Methods

json<T>() → ApiCacheCodec<T>
For answers that are already JSON-shaped.