getStringList static method
Get the data as list of String.
Specify the key of the value you want to get for key
.
If the value does not exist in the specified key
,
the value of defaultValue
will be returned.
Implementation
static List<String> getStringList(String key,
[List<String> defaultValue = const []]) {
if (!isInitialized) {
debugPrint(
"It has not been initialized. Please initialize it by executing [initialize()].");
return const [];
}
if (!containsKey(key)) {
return defaultValue;
}
return _preferences?.getStringList(key) ?? defaultValue;
}