PrefType enum
Storage types for preferences.
Each type has different persistence characteristics:
-
local: Persisted locally using SharedPreferences (localStorage on web). Survives app restarts but not reinstalls.
-
remote: Persisted in remote storage (e.g., Supabase, Firebase). Syncs across devices and survives reinstalls.
-
volatile: Kept only in memory during the current session. Lost when the app closes or reloads.
Values
- local → const PrefType
-
Persists locally on the device using SharedPreferences.
- ✅ Survives app restarts
- ✅ Works offline
- ❌ Lost on app reinstall
- ❌ Not synced across devices
- remote → const PrefType
-
Persists in remote storage configured via RemotePrefs.
- ✅ Survives app restarts and reinstalls
- ✅ Syncs across devices
- ⚠️ Requires network connection
- ⚠️ Slower than local storage
- volatile → const PrefType
-
Stored only in memory for the current session.
- ✅ Very fast access
- ❌ Lost on app close/reload
- ❌ Not persisted anywhere
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited