PrfEncodedAdapter<T, TStore> class abstract

Base adapter for types that need encoding before storing in SharedPreferences.

This abstract class handles the conversion between a type T and a storage type TStore that is directly supported by SharedPreferences (like String or int). Implementations need to provide encode and decode methods.

Inheritance
Implementers

Constructors

PrfEncodedAdapter.new()
Creates a new encoded adapter.

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

decode(TStore? stored) → T?
Decodes a value of storage type TStore back to type T.
encode(T value) → TStore
Encodes a value of type T to the storage type TStore.
getter(SharedPreferencesAsync prefs, String key) Future<T?>
Retrieves a value of type T from SharedPreferences.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setter(SharedPreferencesAsync prefs, String key, T value) Future<void>
Stores a value of type T in SharedPreferences.
override
toString() String
A string representation of this object.
inherited

Operators

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