PrfyEnum<T extends Enum> class
An isolate-safe enum preference.
This class is deprecated. Use PrfIso.enumerated instead.
Example:
final theme = PrfIso.enumerated<Theme>('theme', values: Theme.values);
- Inheritance
-
- Object
- BasePrfObject<
T> - PrfyEnum
- Annotations
-
- @Deprecated('Use PrfIso.enumerated instead. This class will be removed in a future version.')
Constructors
-
PrfyEnum.new(String key, {required List<
T> values, T? defaultValue}) - Creates a new isolate-safe enum preference.
Properties
-
adapter
→ EnumAdapter<
T> -
Gets the adapter used to convert between the enum and its storage representation.
no setteroverride
- defaultValue → T?
-
Optional default value to use when no value exists for key.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
The key used to store this preference in SharedPreferences.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getValue(
SharedPreferencesAsync prefs) → Future< T?> -
Gets the value from SharedPreferences.
inherited
-
isValueNull(
SharedPreferencesAsync prefs) → Future< bool> -
Checks if the stored value is null.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeValue(
SharedPreferencesAsync prefs) → Future< void> -
Removes the value from SharedPreferences.
inherited
-
setValue(
SharedPreferencesAsync prefs, T value) → Future< void> -
Stores
value
in SharedPreferences.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited