putDouble method

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

Implementation

Future<bool> putDouble(String key, double 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!.setDouble(encKey, value);
    }
  } else {
    await _hiveBox!.put(key, value);
    return true;
  }
}