flutter_neo_shield library
Client-side PII protection toolkit for Flutter.
Auto-scrubs sensitive data from logs, secures clipboard with timed auto-clear, and protects sensitive strings in memory.
import 'package:flutter_neo_shield/flutter_neo_shield.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
FlutterNeoShield.init();
runApp(MyApp());
}
Classes
- ClipboardCopyResult
- Represents the result of a secure clipboard copy operation.
- ClipboardShield
- Singleton clipboard protection manager.
- ClipboardShieldConfig
- Configuration for the ClipboardShield module.
- Deobfuscator
- Provides runtime deobfuscation for strings that were obfuscated at compile time by the String Shield generator.
- DetectionEvent
- A detection event record containing the type and timestamp.
- FlutterNeoShield
- Main entry point and convenience class for flutter_neo_shield.
- FlutterNeoShieldLinux
- Linux plugin stub.
- FlutterNeoShieldMacOS
- macOS plugin stub.
- FlutterNeoShieldWindows
- Windows plugin stub.
- JsonSanitizer
- Utility class for sanitizing PII from JSON maps and lists.
- LogShield
- Singleton log sanitization manager.
- LogShieldConfig
- Configuration for the LogShield module.
- MemoryShield
- Singleton manager that tracks all active secure containers and can mass-wipe.
- MemoryShieldConfig
- Configuration for the MemoryShield module.
- Obfuscate
- Marks a string constant for compile-time obfuscation.
- ObfuscateClass
- Marks a class for compile-time string obfuscation.
- PIIDetector
- The core PII detection and sanitization engine.
- PIIMatch
- Represents a single PII match found within a string.
- PIIPattern
- Defines a PII detection pattern with its regex, type, and replacement text.
- RaspShield
- Runtime App Self Protection (RASP) main interface.
- SecureBytes
- A secure container for sensitive byte arrays that overwrites on dispose.
- SecureCopyButton
- A widget that copies text securely to the clipboard on tap.
- SecureDisposable
- Interface for objects that can be securely disposed by MemoryShield.
- SecurePasteField
- A TextField wrapper that automatically clears the clipboard after paste.
- SecureString
- A secure container for sensitive strings that overwrites content on dispose.
-
SecureValue<
T> - A generic secure container for any sensitive value with auto-dispose.
- SecurityReport
- Consolidated report of a full security scan
- SecurityResult
- Result of a single security detection check
- ShieldConfig
- Global configuration for the flutter_neo_shield PII detection engine.
- ShieldReport
- Tracks PII detection statistics across the application.
- StringShield
- Singleton manager for runtime string deobfuscation.
- StringShieldConfig
- Configuration for the StringShield module.
Enums
- ObfuscationStrategy
- The strategy used to obfuscate a string at compile time.
- PIIType
- Enum representing the types of Personally Identifiable Information (PII) that the detection engine can recognize.
- SecurityMode
- Security detection response types.
Functions
-
secureCopy(
String text, {Duration? expireAfter}) → Future< ClipboardCopyResult> -
Convenience function to securely copy
textto the clipboard. -
shieldLog(
String message, {String level = 'INFO', String? tag}) → void -
Sanitizes PII from
messageand logs it with a level and optional tag. -
shieldLogError(
String message, {Object? error, StackTrace? stackTrace}) → void - Sanitizes PII from error messages and logs them.
-
shieldLogJson(
String label, Map< String, dynamic> json) → void - Sanitizes PII from a JSON map and logs it.
Exceptions / Errors
- SecurityException
- Exception thrown by RaspShield when running in SecurityMode.strict and a threat is detected.