getBool static method

bool getBool(
  1. String key, {
  2. bool defValue = false,
})

get bool. 获取sp中key的布尔值

Implementation

static bool getBool(String key, {bool defValue = false}) {
  if (_prefs == null) {
    return defValue;
  }
  return _prefs?.getBool(key) ?? defValue;
}