EnumAdapter<T extends Enum> class

Adapter for Enum values.

Stores enum values as their integer indices.

Inheritance

Constructors

EnumAdapter.new(List<T> values)
Creates a new enum adapter with the specified list of enum values.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
values List<T>
The list of all possible enum values in their declaration order.
final

Methods

decode(int? index) → T?
Decodes a value of storage type TStore back to type T.
override
encode(T value) int
Encodes a value of type T to the storage type TStore.
override
getter(SharedPreferencesAsync prefs, String key) Future<T?>
Retrieves a value of type T from SharedPreferences.
inherited
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.
inherited
toString() String
A string representation of this object.
inherited

Operators

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