NumAdapter class
Adapter for numeric values.
Stores numeric values as doubles in SharedPreferences. This adapter can handle both integer and floating-point numbers, converting them to and from double values.
- Inheritance
-
- Object
- PrfAdapter<
num> - PrfEncodedAdapter<
num, double> - NumAdapter
Constructors
- NumAdapter.new()
-
Creates a new numeric adapter.
const
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(
double? stored) → num? -
Decodes a value of storage type
TStore
back to typeT
.override -
encode(
num value) → double -
Encodes a value of type
T
to the storage typeTStore
.override -
getter(
SharedPreferencesAsync prefs, String key) → Future< num?> -
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, num 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