PreferencesUtilities class Null safety
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.
read-onlyinherited
- preferences → BaseSharedPreferences?
-
read-only
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
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 non-existent 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 therunTimeType
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
-
read-only
Static Methods
-
clearInstance(
) → void - Clear the given prefrences instance to test.
-
init(
[BaseSharedPreferences? preferences]) → Future< void> -
init the class in
main
function.