getStringList static method

List<String> getStringList(
  1. String? key, [
  2. List<String>? defValue
])

Returns empty List if key is null.

Implementation

static List<String> getStringList(String? key, [List<String>? defValue]) {
  if (key == null) {
    return [''];
  }
  assert(_initCalled,
      'Prefs.init() must be called first in an initState() preferably!');
  assert(_prefsInstance != null,
      'Maybe call Prefs.getStringListF(key) instead. SharedPreferences not ready yet!');
  return _prefsInstance?.getStringList(key) ?? defValue ?? [''];
}