v3.0.1
encrypted_shared_preferences
이 플러그인은 공유된 선호도를 디바이스 저장소에 암호화된 값으로 저장합니다.
84좋아요 4.6천30일 다운로드140Pub 점수
AndroidiOSWebmacOSWindowsLinux
암호화된 공유 설정을 위한 플러터 플러그인
^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