vyuh_plugin_storage_secure 1.7.0
vyuh_plugin_storage_secure: ^1.7.0 copied to clipboard
A secure storage plugin for Vyuh using flutter_secure_storage for encrypted data storage across platforms
Vyuh Secure Storage Plugin
Secure Storage Plugin for Vyuh Framework using flutter_secure_storage
Vyuh Secure Storage Plugin 🔐 #
A secure storage plugin for the Vyuh framework that provides encrypted key-value storage for sensitive information using platform-specific secure storage mechanisms:
- iOS and macOS: Keychain
- Android: encrypted storage backed by the Android Keystore
- Web: encrypted browser storage
- Linux: Secret Service API
- Windows: Windows Credential Manager
Installation #
dependencies:
vyuh_plugin_storage_secure: ^1.6.0
Setup #
The package re-exports the platform option classes of
flutter_secure_storage, so you don't need to depend on it directly.
import 'package:vyuh_core/vyuh_core.dart' as vyuh;
import 'package:vyuh_plugin_storage_secure/vyuh_plugin_storage_secure.dart';
void main() {
vyuh.runApp(
plugins: vyuh.PluginDescriptor(
secureStorage: FlutterSecureStoragePlugin(
iOSOptions: const IOSOptions(
accessibility: KeychainAccessibility.first_unlock,
),
),
),
features: () => [/* ... */],
);
}
Usage #
final storage = vyuh.vyuh.secureStorage;
await storage.write('auth.token', 'your-secure-token'); // returns the stored string
final token = await storage.read('auth.token'); // String?
final hasToken = await storage.has('auth.token');
final deleted = await storage.delete('auth.token'); // false if it wasn't there
Values are stored as strings: write stores value.toString() and returns
it. Writing null deletes the key. Using the plugin before init or after
dispose throws a StateError.
Contributing 🤝 #
Contributions are welcome! Please read our contributing guidelines to get started.
Made with ❤️ by Vyuh