secure_content
3.1.1, released 3 days ago by hashstudios.dev
Protect Flutter screens from screenshots, recordings, and unauthorized access.
What it does
Adds native screen‑capture protection, screenshot/recording detection, biometric re‑authentication, inactivity auto‑lock, integrity checks and a secure clipboard with TTL. It works on Android and iOS via a Flutter plugin.
AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- Handling confidential or personal data in the UI
- Compliance requirements (GDPR, HIPAA, etc.)
- Apps that need to prevent screen capture or enforce biometric re‑auth
Skip it when
- Simple apps without sensitive screens
- When targeting platforms other than Android/iOS
- When native build‑step complexity is unacceptable
Strengths
- Full‑screen capture protection on both platforms
- Biometric re‑auth and integrity risk detection
- Configurable app‑switcher branding and watermark overlay
- Sensitive clipboard with automatic expiry
Weaknesses
- Requires native configuration (Info.plist entry, FlutterFragmentActivity, specific themes)
- Limited to Android and iOS only
- Adds runtime overhead for monitoring events
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 1
Add NSFaceIDUsageDescription to iOS Info.plist; extend Android activity from FlutterFragmentActivity and use an AppCompat theme for API 23‑27; compile with Flutter 3.44+, Android SDK 37, iOS 13+; ensure Swift 6 compiler (Xcode 16).
import 'package:flutter/material.dart';
import 'package:secure_content/secure_content.dart';
SecureContentScope(
enabled:true,
protectInAppSwitcher:true,
appSwitcherColor:Colors.black,
policy:const SecureContentPolicy(
requireBiometricOnResume:true,
inactivityTimeout:Duration(seconds:30),
enableIntegrityChecks:true,
hardBlockOnIntegrityRisk:false,
enableRiskWatermark:true,
watermarkText:'CONFIDENTIAL',
),
child:const YourSensitiveWidget(),
);Alternatives
Packages that do the same job and could replace secure_content.
- local_auth
Provides biometric authentication without screen‑capture protection, useful if only auth is needed.
90Compare