EaseXStorage class

๐Ÿ“ฆ Simplified key-value storage using SharedPreferences. Usage:

  • EaseXStorage.setString('token', 'abc123')
  • final token = EaseXStorage.getString('token')

Constructors

EaseXStorage()

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 false if key doesn't exist).
getString(String key) โ†’ String?
๐Ÿ“– Get a String value (returns null if 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.