all_src/utils/shared_pref
library
Functions
-
clearSharedPref()
→ Future<bool>
-
clear SharedPref
-
getBool(String key, {dynamic defaultValue = false})
→ Future<bool>
-
Returns a Bool if exists in SharedPref
-
getBoolAsync(String key, {bool defaultValue = false})
→ bool
-
Returns a Bool if exists in SharedPref
-
getDouble(String key, {dynamic defaultValue = 0.0})
→ Future<double>
-
Returns a Double if exists in SharedPref
-
getDoubleAsync(String key, {double defaultValue = 0.0})
→ double
-
Returns a Double if exists in SharedPref
-
getInt(String key, {dynamic defaultValue = 0})
→ Future<int>
-
Returns a Int 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
-
getSharedPref()
→ Future<SharedPreferences>
-
Returns SharedPref Instance
-
getString(String key, {dynamic defaultValue = ''})
→ Future<String>
-
Returns a String if exists in SharedPref
-
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
-
setBool(String key, bool value)
→ Future<bool>
-
add a Bool in SharedPref
-
setBoolAsync(String key, bool value)
→ Future<bool>
-
add a Bool in SharedPref
-
setDouble(String key, double value)
→ Future<bool>
-
add a Double in SharedPref
-
setDoubleAsync(String key, double value)
→ Future<bool>
-
//////////////////////////////////////////////////////////////////// DEPRECATED \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
add a Double in SharedPref
-
setInt(String key, int value)
→ Future<bool>
-
add a Int in SharedPref
-
setIntAsync(String key, int value)
→ Future<bool>
-
add a Int in SharedPref
-
setJSONAsync(String key, String value)
→ Future<bool>
-
add a JSON in SharedPref
-
setString(String key, String value)
→ Future<bool>
-
add a String in SharedPref
-
setStringAsync(String key, String value)
→ Future<bool>
-
add a String in 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