putBoolean method

Future<bool> putBoolean(
  1. String key,
  2. bool value
)

Implementation

Future<bool> putBoolean(String key, bool value) async {
  if (_config.type == StorageType.sharedPreferences) {
    final encKey = _encryptKey(key);
    if (_config.enableEncryption) {
      final encValue = _encryptValue(value.toString());
      return await _prefs!.setString(encKey, encValue);
    } else {
      return await _prefs!.setBool(encKey, value);
    }
  } else {
    await _hiveBox!.put(key, value);
    return true;
  }
}