getBool static method
获取bool类型数据,如果没有则返回默认值
key 键
defValue 默认值:默认为false
Implementation
static Future<bool> getBool(String key, [bool defValue = false]) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
bool? value = prefs.getBool(key) ?? defValue;
_println('getBool', key, value);
return value;
}