getStringList static method

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

获取sp中key的list

Implementation

static List<String> getStringList(String? key,
    {List<String> defValue = const []}) {
  if (key == null || key.isEmpty) {
    return defValue;
  }
  return _preferences.getStringList(key) ?? defValue;
}