getDouble method
Implementation
double getDouble(String key, {double defaultValue = 0.0}) {
if (_config.type == StorageType.sharedPreferences) {
final encKey = _encryptKey(key);
if (_config.enableEncryption) {
final encValue = _prefs!.getString(encKey);
if (encValue == null) return defaultValue;
try {
final decrypted = _decryptValue(encValue);
return double.tryParse(decrypted) ?? defaultValue;
} catch (e) {
debugPrint('Decryption failed for key: $key');
return defaultValue;
}
} else {
return _prefs!.getDouble(encKey) ?? defaultValue;
}
} else {
return _hiveBox!.get(key, defaultValue: defaultValue) as double? ??
defaultValue;
}
}