dartpub.dev DartNative · beta
plugins / dartnative_secure_storage
ds

dartnative_secure_storage

v1.0.0 dartpub Free

Encrypted key-value storage

The native secure storage for DartNative — encrypted key–value storage behind the familiar `flutter_secure_storage` API, backed by the iOS `Keychain` and Android `EncryptedSharedPreferences`.

by DartNative/dartnative_secure_storage · DartNative ≥ 3.0 · updated 3 weeks ago
Install
Free
pubspec.yaml
dependencies:
  dartnative_secure_storage: ^1.0.0
Weekly installs
40
Active apps
7
Rating
0.0 · 0
Open issues
0

dartnative_secure_storage

Encrypted key–value storage for DartNative — the iOS Keychain and Android EncryptedSharedPreferences behind the familiar flutter_secure_storage API. iOS and Android.

Why you'll like it

  • Encrypted at rest — Keychain on iOS, EncryptedSharedPreferences on Android.
  • Familiar APIread / write / delete / readAll / deleteAll / containsKey, like flutter_secure_storage.
  • Zero setup — self-contained native bridge over FFI; no MethodChannel, no extra wiring.

Highlights

  • read({key}) / write({key, value}) / delete({key})
  • readAll() / deleteAll() / containsKey({key}) — enumerate, clear, or test for a key.

Most IOSOptions / AndroidOptions parameters are accepted for source compatibility but ignored — the plugin uses sensible defaults (Keychain AfterFirstUnlockThisDeviceOnly on iOS, EncryptedSharedPreferences AES-256 on Android). The exception is AndroidOptions.resetOnError (default true, Android-only, matching upstream): if the encrypted keyset can't be decrypted (e.g. after a backup-restore), the store is wiped and recreated instead of failing.

Install

dependencies:
  dartnative_secure_storage: ^1.0.0   # from dartpub.dev
dn pub get
void main() {
  DartNativePluginRegistrant.registerAll();
  runApp(const MyApp());
}

Quick look

import 'package:dartnative_secure_storage/dartnative_secure_storage.dart';

final storage = SecureStorage();

await storage.write(key: 'token', value: 'abc123');
final token = await storage.read(key: 'token');   // 'abc123' or null
await storage.delete(key: 'token');

Read everything, or clear it:

final all = await storage.readAll();   // Map<String, String>
await storage.deleteAll();

Platform setup

iOS

No native setup required.

Android

No native setup required.

Example

The example/ app writes, reads, and clears a secret — borrow from it freely.

Credits & license

API mirrors flutter_secure_storage (BSD-3-Clause); the plugin ships its own native bridge — Keychain on iOS, EncryptedSharedPreferences on Android — over FFI, built on the DartNative framework's runtime (FFI loader, and the Android application context).

Commercial plugin distributed via dartpub.dev — file issues on the plugin's page.