getBool static method

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

获取sp中key的布尔值

Implementation

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