common/utils/shared_pref library

Functions

clearSharedPref() Future<bool>
clear SharedPref
getBoolAsync(String key, {bool defaultValue = false}) bool
Returns a Bool if exists in SharedPref
getDoubleAsync(String key, {double defaultValue = 0.0}) double
Returns a Double if exists in SharedPref
getIntAsync(String key, {int defaultValue = 0}) int
Returns a Int if exists in SharedPref
getJSONAsync(String key, {Map<String, dynamic>? defaultValue}) Map<String, dynamic>
Returns a JSON if exists in SharedPref
getMatchingSharedPrefKeys(String key) List<String>
Returns List of Keys that matches with given Key
getStringAsync(String key, {String defaultValue = ''}) String
Returns a String if exists in SharedPref
getStringListAsync(String key) List<String>?
Returns a StringList if exists in SharedPref
removeKey(String key) Future<bool>
remove key from SharedPref
setValue(String key, dynamic value, {bool print = true}) Future<bool>
Add a value in SharedPref based on their type - Must be a String, int, bool, double, Map<String, dynamic> or StringList