v3.0.1
encrypted_shared_preferences
इस प्लगइन के द्वारा डिवाइस स्टोरेज पर साझा प्राथमिकताओं को एन्क्रिप्टेड मानों के रूप में स्टोर किया जाता है।
84लाइक 4.6 हज़ार30-दिन डाउनलोड140Pub अंक
AndroidiOSWebmacOSWindowsLinux
एन्क्रिप्टेड साझा प्राथमिकताओं के लिए Flutter प्लगइन
^5.0.1^2.0.8यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।
This plugin stores Shared Preferences as encrypted values. It is decrypted when retrieved. You could use this side by side with regular Shared Preferences.
EncryptedSharedPreferences encryptedSharedPreferences = EncryptedSharedPreferences();
encryptedSharedPreferences.setString('sample', 'Hello, World!').then((bool success) {
if (success) {
print('success');
} else {
print('fail');
}
});
encryptedSharedPreferences.getString('sample').then((String value) {
print(value); /// Prints Hello, World!
});
encryptedSharedPreferences.remove('sample').then((bool success) {
if (success) {
print('success');
} else {
print('fail');
}
});
/// Clears all values, including those you saved using regular Shared Preferences.
encryptedSharedPreferences.clear().then((bool success) {
if (success) {
print('success');
} else {
print('fail');
}
});
encryptedSharedPreferences.reload();
/// You can pass a custom SharedPreferences instance (e.g. A newer version of SharedPreferences)
final prefs = await SharedPreferences.getInstance();
EncryptedSharedPreferences encryptedSharedPreferences = EncryptedSharedPreferences(prefs: prefs);
// You can access the internal SharedPreferences instance to invoke methods not exposed by regular EncryptedSharedPreferences
SharedPreferences instance = await encryptedSharedPreferences.getInstance();
int counter = 1;
/// Access SharedPreferences' setInt method
await instance.setInt('counter', counter);
Default mode is SIC AESMode.sic, you can override it using the mode named parameter:
EncryptedSharedPreferences encryptedSharedPreferences = EncryptedSharedPreferences(mode: AESMode.cbc);
AESMode.cbcAESMode.cfb64AESMode.ctrAESMode.ecbAESMode.ofb64GctrAESMode.ofb64AESMode.sic