flutter_privacy_vault 1.2.0
flutter_privacy_vault: ^1.2.0 copied to clipboard
Security and privacy vault for Flutter. App-switcher privacy shield, inactivity auto-lock with biometrics, and sensitive balance masking.
flutter_privacy_vault #
A production security and privacy vault for Flutter applications. Built for Fintech, Banking, Crypto, and Healthcare apps requiring app-switcher privacy shielding, inactivity auto-locking with biometric unlock, and selective sensitive data masking.
⚡ Why flutter_privacy_vault? #
Mobile operating systems automatically capture snapshots of your application interface when users switch apps or open the multitasking tray. For banking and confidential apps, this leaks account balances, card numbers, and confidential records.
flutter_privacy_vault provides a declarative, zero-native-headache solution:
- 🛡️ App-Switcher Privacy Shield: Detects when the app loses focus or enters the background, instantly overlaying a frosted Gaussian blur or branded lock screen.
- ⏱️ Idle Inactivity Lock: Tracks user touch, pointer, and keyboard interactions across the entire widget hierarchy. If the user is idle past your configured threshold (e.g. 60 seconds), it automatically locks the screen and triggers your biometric/PIN prompt.
- 👁️ Sensitive Data Masking:
PrivacyMaskwidget allows wrapping balances ($142,850.75➔••••••••or Gaussian blur) with a global or localized toggle. - 🌐 Multi-Platform: Pure Flutter implementation with zero platform channel crashes across iOS, Android, Web, macOS, Windows, and Linux.
🚀 Features #
| Feature | Description |
|---|---|
| 🛡️ Background Privacy Shield | Automatic Gaussian blur or custom branded overlay when the app moves to background or the multitasking switcher. |
| ⏱️ Inactivity Auto-Lock | Listens to all user interaction events with zero UI performance penalty; locks vault upon timeout. |
| 👁️ PrivacyMask Widget | Selective masking for numbers and text with bullets (••••••••), blur, or redacted styles. |
| 📱 Biometric / PIN Hooks | Simple callbacks (onLocked, onUnlocked) to wire into local_auth or custom PIN pads. |
| ⚡ Reactive Controller | Global PrivacyVaultController to query isLocked, isDataMasked, or manually trigger locks. |
📦 Installation #
Add flutter_privacy_vault to your pubspec.yaml:
flutter pub add flutter_privacy_vault
💡 Quick Start #
1. Wrap your App Root in PrivacyVault #
import 'package:flutter/material.dart';
import 'package:flutter_privacy_vault/flutter_privacy_vault.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
builder: (context, child) {
return PrivacyVault(
config: PrivacyVaultConfig(
enableBackgroundShield: true,
inactivityTimeout: const Duration(minutes: 2),
lockOnInactivity: true,
onLocked: () => print('Vault locked!'),
),
child: child ?? const SizedBox.shrink(),
);
},
home: const BankingHomeScreen(),
);
}
}
2. Mask Sensitive Balances & Fields #
// Bullets masking ($14,250.00 -> ••••••••)
PrivacyMask(
style: MaskingStyle.bullets,
child: Text(
'\$14,250.00',
style: TextStyle(fontSize: 28, fontWeight: FontWeight.bold),
),
)
// Gaussian blur masking
PrivacyMask(
style: MaskingStyle.blur,
blurSigma: 6.0,
child: Text('Card: 4820 9182 4410 9921'),
)
3. Programmatic Controls #
// Toggle masking for all PrivacyMask widgets in your app
PrivacyVaultController.toggleDataMasking();
// Manually lock vault (e.g. user taps "Lock Now")
PrivacyVaultController.lock();
// Unlock vault (e.g. after successful fingerprint check)
PrivacyVaultController.unlock();
🔗 Related Packages by Author #
- ai_stream_bubble — High-performance streaming AI message bubble with DeepSeek/Claude reasoning accordions.
- flutter_sonner — Opinionated stacked action toast & notification HUD with spring physics.
- ai_voice_orb — Fluid neural voice orb for Conversational AI & voice agents.
- spatial_card — 3D tactile interactive cards & multi-plane parallax surfaces.
💖 Support the Project #
If you find this project useful, consider supporting its active maintenance and future development:
📄 License #
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Maintained with ❤️ by Govind Tank.