EaseXStorage class
๐ฆ Simplified key-value storage using SharedPreferences. Usage:
EaseXStorage.setString('token', 'abc123')final token = EaseXStorage.getString('token')
Constructors
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
-
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
Static Methods
-
clear(
) โ Future< bool> - ๐งน Clear all stored data.
-
getBool(
String key, {bool defaultValue = false}) โ bool -
๐ Get a bool value (defaults to
falseif key doesn't exist). -
getString(
String key) โ String? -
๐ Get a String value (returns
nullif key doesn't exist). -
init(
) โ Future< void> - Initialize SharedPreferences (call this once before use).
-
remove(
String key) โ Future< bool> - ๐๏ธ Delete a key.
-
setBool(
String key, bool value) โ Future< bool> - โ Save a bool value.
-
setString(
String key, String value) โ Future< bool> - ๐๏ธ Save a String value.