PreferencesUtilities class

Acts as a wraper for SharedPreferences to make saving and geting saved value as easy as possible in addition of adding more cool feature like removing muliple values at once.

Properties

hashCode int
The hash code for this object.
no setterinherited
preferences BaseSharedPreferences?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearAll() Future<bool>
Clear all app saved preferences.
getValueWithKey<E>(String key) → E?
Get a saved value using given Key.
isEmpty() bool
Retuns true if the local storage is empty.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeMultipleValuesWithKeys(List<String> keys) Future<void>
Remove saved values with Keys form local DB.
removeValueWithKey(String key) Future<bool>
Remove saved value with Key form local DB.
saveValueWithKey<T>(String key, T value) Future<bool>
T is the runTimeType data which you are trying to save (bool - String - double)
setLoggerMode(Level level) → void
Change the logger level. defaults to Level.nothing
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance PreferencesUtilities
no setter

Static Methods

clearInstance() → void
Clear the given prefrences instance to test.
init([BaseSharedPreferences? preferences]) Future<void>
init the class in main function.