getStringList static method

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

获取List

Implementation

static Future<List<String>> getStringList(String key, [List<String> defValue = const []]) async {
  SharedPreferences prefs = await SharedPreferences.getInstance();
  List<String>? value = prefs.getStringList(key) ?? defValue;
  _println('getStringList', key, value);
  return value;
}