EnumAdapter<T extends Enum> class
Adapter for Enum values.
Stores enum values as their integer indices.
- Inheritance
-
- Object
- PrfAdapter<
T> - PrfEncodedAdapter<
T, int> - EnumAdapter
Constructors
-
EnumAdapter.new(List<
T> values) - Creates a new enum adapter with the specified list of enum values.
Properties
Methods
-
decode(
int? index) → T? -
Decodes a value of storage type
TStore
back to typeT
.override -
encode(
T value) → int -
Encodes a value of type
T
to the storage typeTStore
.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