flutter_secure_storage
11.2.0, released 2 months ago by steenbakker.dev
Secure key-value storage using platform-specific secure mechanisms
What it does
Provides encrypted storage for sensitive data on Android, iOS, macOS, Windows, Linux, and Web. It uses platform keychains or custom ciphers and supports optional biometric authentication.
AI-written summary of version 11.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Storing authentication tokens or passwords
- Persisting small amounts of sensitive configuration
- Implementing secure onboarding data
Skip it when
- Storing large blobs or media
- Using it as a general-purpose database
- Relying on it for non-sensitive data
Strengths
- Built-in encryption with RSA OAEP + AES-GCM
- Cross-platform support with native APIs
- Optional biometric authentication and accessibility options
Weaknesses
- Web support limited to HTTPS or localhost
- Requires native configuration (e.g., disabling backup on Android)
- No built-in migration for schema changes
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 6
Call WidgetsFlutterBinding.ensureInitialized(); disable Android backup via AndroidManifest; use HTTPS for Web; add dependency in pubspec.yaml
final storage = FlutterSecureStorage();
await storage.write(key: 'token', value: 'abc123');
String? token = await storage.read(key: 'token');Alternatives
Packages that do the same job and could replace flutter_secure_storage.
- tostore
Local data engine providing key-value, SQL/NoSQL tables, vector embeddings, and hybrid text search.
88Compare - simple_secure_storage
Secure key‑value storage for Flutter with platform‑specific backends.
77Compare - flutter_secure_storage_x
API to store data securely using native device storage like Keychain and KeyStore.
78Compare - biometric_storage
Encrypted file store optionally secured by biometric locks for mobile and desktop.
50Compare
Works with
Packages commonly used together with flutter_secure_storage: ones it builds on, ones built on it, and its own family.
- oauth2_clientBuilt on flutter_secure_storageInteract with OAuth2 servers and handle token storage and refreshing in Flutter.
- oidc_default_storeBuilt on flutter_secure_storageSecure OIDC token storage using flutter_secure_storage and shared_preferences
- dart_pdf_editorBuilt on flutter_secure_storageFlutter PDF editor and viewer with native rendering and editing tools
- nylo_supportBuilt on flutter_secure_storageSupport library for the Nylo framework offering routing, networking, storage, widgets and more.
- koolbase_flutterBuilt on flutter_secure_storageFlutter SDK for Koolbase BaaS providing auth, database, storage, realtime and OTA updates.
- json_storeBuilt on flutter_secure_storageA key-value storage solution built on sqflite with encryption and time-to-live support.
- solidpodBuilt on flutter_secure_storageAccess and manage private data stores on Solid servers.
- magicBuilt on flutter_secure_storageFull‑stack Flutter framework offering Laravel‑style models, auth, routing, realtime and payments across all platforms.