no_screenshot 1.3.0-beta.1
no_screenshot: ^1.3.0-beta.1 copied to clipboard
Flutter plugin to prevent screenshots, detect screen recording, and show blur/color/image overlays in the app switcher on Android, iOS, macOS, Linux, Windows, and Web.
1.3.0-beta.1 #
Beta — please test before the stable 1.3.0. This release changes how prevention state is tracked internally (details below). If your app mixes
screenshotOff()/screenshotOn()with the overlay-mode APIs, please verify your flows and report issues.
- feat: added
overlayOff()— an idempotent method that deterministically disables any active app-switcher overlay mode (image, blur, or color), without needing to know the current state (#115). The counterpart to the existingscreenshotWithImage()/screenshotWithBlur()/screenshotWithColor()enable methods. - feat (behavior change): prevention is now tracked as two separate claims on every platform —
screenshotOff()/screenshotOn()/toggleScreenshot()own an independent claim, and an active overlay mode holds its own claim. Protection stays engaged while either claim is held. No API signatures changed, and apps that use only the plain methods or only the overlay methods behave exactly as before; sequences that mix the two APIs now resolve fail-secure instead of silently dropping protection:screenshotWithBlur()→screenshotOff()→overlayOff(): prevention now stays on (the independent claim survives; previously it was silently dropped).screenshotWithBlur()→screenshotOn(): prevention now stays on while the overlay is active (the overlay's claim survives; previously prevention dropped while the blur overlay kept showing in the app switcher).screenshotOff()→toggleScreenshotWithBlur()on/off: prevention now stays on after the overlay toggles off (previously dropped).- To fully disable protection, release both claims — e.g.
overlayOff()+screenshotOn()(whatSecureWidget/applyOverlayMode(OverlayMode.none)do). - The persisted state gains an
independent_preventionkey; state written by older versions is migrated automatically (one-shot) on first launch. toggleScreenshot()now toggles the plugin's own independent claim rather than inspecting the current window flag. If your app setsFLAG_SECURE(or the platform equivalent) outside this plugin, do not mix that withtoggleScreenshot()— usescreenshotOff()/screenshotOn()explicitly.
- fix:
SecureWidgetteardown,applyOverlayMode(OverlayMode.none), andapplyOverlayMode(OverlayMode.secure)now clear any active overlay mode. Previously they only calledscreenshotOn(), which leaves the overlay mode active (and persisted) — so a disposedSecureWidget(mode: OverlayMode.blur)kept showing the blur overlay in the app switcher. - fix:
applyOverlayMode(OverlayMode.secure)takes the independent prevention claim before releasing the overlay's claim, so prevention stays continuously engaged across an overlay → secure transition (no transient unprotected frame).
1.2.0 #
- fix(android): removed a duplicate Kotlin source-directory registration that made the plugin fail to compile on Flutter 3.44.4+ with "Conflicting declarations" errors (#114).
- fix(ios): screenshot prevention now attaches lazily on the first method call, so
screenshotOff()works even when scene lifecycle events never reach the plugin — e.g. apps migrated to the UIScene lifecycle with a customSceneDelegatethat does not subclassFlutterSceneDelegate(#105).screenshotOff()/toggleScreenshot()now returnfalseinstead of a misleadingtruewhen protection could not engage because no window is available yet. - fix(ios): iOS builds running on Apple-silicon Macs ("Designed for iPhone/iPad") no longer show a permanently black/white window at launch (#107). Screenshot prevention is not supported by this technique on a macOS host, so
screenshotOff()now returnsfalsethere; app-switcher overlays and screenshot/recording detection are unaffected. - fix(android): migrated to AGP's built-in Kotlin support following the official plugin migration guide, so the plugin keeps building on AGP 9+ where applying the Kotlin Gradle Plugin is no longer allowed (#104, #110).
- fix(macos): replaced
CGWindowListCreateImage(removed in the macOS 26 "Tahoe" SDK) withcacheDisplayfor the blur-overlay snapshot, keeping the plugin compiling against the latest SDK without requiring Screen Recording permission (#109). Because Flutter renders into aCAMetalLayerthat AppKit snapshots cannot capture, the blur overlay on macOS now always uses the system blur material andblurRadiushas no effect there; content remains fully obscured in Mission Control / the app switcher. Also fixes blur-overlay edges fading to transparent on iOS and macOS, thanks to @paulanatoleclaudot-betclic (#102).
1.1.0 #
-
breaking: renamed overlay image assets on all platforms to avoid generic-name collisions (#99) by @yar-tsar.
Migration — rename your overlay image files:
Platform Before After Android res/drawable/image.pngres/drawable/no_screenshot_image.pngiOS Assets.xcassets/image.imageset/Assets.xcassets/NoScreenshotImage.imageset/macOS Assets.xcassets/image.imageset/Assets.xcassets/NoScreenshotImage.imageset/No Dart-side code changes are required — only the asset files need to be renamed.
1.0.0 #
- feat(android): added Android 15 (API 35) screen recording detection via
WindowManager.addScreenRecordingCallback— provides true start/stop detection withSCREEN_RECORDING_STATE_VISIBLE/SCREEN_RECORDING_STATE_NOT_VISIBLE(#98) by @fonkamloic. - feat(android): layered backward compatibility — API 35+ uses
WindowManager.addScreenRecordingCallback, API 34 falls back toActivity.ScreenCaptureCallback, API <34 graceful no-op by @fonkamloic. - docs: updated README with Android 15 recording detection details, platform behavior table, and upgrade notes by @fonkamloic.
0.10.0 #
- feat(ios): migrate to
UIScenelifecycle for iOS 26+ compatibility — addFlutterSceneLifeCycleDelegateconformance so overlay show/hide logic fires under both the legacyUIApplicationDelegateand the newUIScenelifecycle; replace deprecatedUIScreen.mainusages; remove stale iOS 11 availability checks; bump deployment target to iOS 13.0 / Flutter >=3.38.0 by @fonkamloic. - fix(ios): add
@objc(NoScreenshotPlugin)annotation for Swift Package Manager builds — fixes "Unknown receiver 'NoScreenshotPlugin'" compilation error inGeneratedPluginRegistrant.m(#96) by @fonkamloic. - fix(ios): replace
UIVisualEffectViewblur overlay withCIGaussianBlur— the previous implementation darkened the screen instead of blurring it; now captures a window snapshot and applies a true Gaussian blur with configurable radius by @fonkamloic.
0.9.1 #
- chore: add pub.dev topics to pubspec.yaml.
0.9.0 #
- feat(ios, macos): added Swift Package Manager support —
Package.swiftfor both iOS and macOS, with CocoaPods backward compatibility by @fonkamloic. - feat(example): added color picker with 8 preset colors for the color overlay section by @fonkamloic.
- feat(example): added blur radius slider (1–100) that applies the blur overlay in real time by @fonkamloic.
- chore: updated podspec
source_filespaths to reference SPM directory structure by @fonkamloic. - chore: added
.build/and.swiftpm/to.gitignoreand.pubignoreby @fonkamloic.
0.8.0 #
- feat: added
timestampandsourceAppmetadata fields toScreenshotSnapshot— backward-compatible defaults (P8) by @fonkamloic. - feat(android): screenshot metadata via
MediaStore.Images.Media.DATE_ADDEDandDISPLAY_NAMEby @fonkamloic. - feat(ios): screenshot metadata via wall clock at detection time by @fonkamloic.
- feat(macos): screenshot metadata via
kMDItemContentCreationDateandkMDItemCreator/ detected recording app name by @fonkamloic. - feat(linux): screenshot metadata via
G_FILE_ATTRIBUTE_TIME_MODIFIEDand inferred source app from filename prefix by @fonkamloic. - feat(windows): added Windows platform support —
SetWindowDisplayAffinity(WDA_EXCLUDEFROMCAPTURE)for prevention,AddClipboardFormatListener+ReadDirectoryChangesWfor screenshot detection, process scanning for recording detection (P11) by @fonkamloic. - feat: added granular callbacks —
onScreenshotDetected,onScreenRecordingStarted,onScreenRecordingStoppedwithstartCallbacks()/stopCallbacks()/removeAllCallbacks()API (P15) by @fonkamloic. - feat(web): added best-effort web platform support — right-click blocking, PrintScreen interception,
user-select: noneCSS,visibilitychangedetection (P17) by @fonkamloic. - fix: fixed
NoScreenshot.instancecreating a new instance on every access — now a proper cached singleton by @fonkamloic. - fix: changed
_instancePlatformfrom a captured field to a getter so platform is resolved at call time by @fonkamloic. - feat(example): added Granular Callbacks section with real-time event display by @fonkamloic.
- feat(example): added web platform scaffolding by @fonkamloic.
- fix(linux): replaced
FlEventSinkwithfl_event_channel_sendfor stream event delivery by @fonkamloic. - fix(linux): fixed GObject typedefs, recording detection thread safety, stream caching, and platform-specific UI layout by @fonkamloic.
- test: added granular callback tests with mock platform class by @fonkamloic.
- test: added web platform test suite by @fonkamloic.
- test: added
screenshotStreamcoverage for event channel decoding and stream caching by @fonkamloic.
0.7.0 #
- feat: added
SecureWidget— a declarative Flutter widget that auto-enables screenshot protection on mount and disables on unmount (P6) by @fonkamloic. - feat: added
SecureNavigatorObserver— aNavigatorObserverthat applies different protection levels per named route (P7) by @fonkamloic. - feat: added
SecureRouteConfigclass for configuring per-route protection policies withOverlayMode,blurRadius, andcolorby @fonkamloic. - feat: added
OverlayModeenum (none,secure,blur,color,image) andapplyOverlayMode()helper for declarative protection by @fonkamloic. - feat: added idempotent
screenshotWithImage(),screenshotWithBlur(), andscreenshotWithColor()API methods — always enable the overlay (no toggle), safe to call repeatedly by @fonkamloic. - feat: added idempotent native handlers on Android, iOS, macOS, and Linux for the new always-enable methods by @fonkamloic.
- feat(example): added SecureWidget demo page and per-route protection demo with payment, profile, and public pages by @fonkamloic.
- test: added widget tests for
SecureWidget(initState, dispose, didUpdateWidget, all overlay modes) by @fonkamloic. - test: added unit tests for
SecureNavigatorObserver(didPush, didPop, didReplace, didRemove, defaultConfig, custom params) by @fonkamloic. - test: added method channel, platform interface, and
NoScreenshottests for new idempotent methods by @fonkamloic. - docs: updated README with SecureWidget and per-route protection sections, updated API reference table by @fonkamloic.
0.6.0 #
- feat: added configurable
blurRadiusparameter totoggleScreenshotWithBlur({double blurRadius})— defaults to 30.0, customizable per platform by @fonkamloic. - feat: added
toggleScreenshotWithColor({int color})API — solid color overlay for app switcher / recents screen across all platforms by @fonkamloic. - feat(android): color overlay via a solid
Viewwith the specified ARGB color by @fonkamloic. - feat(ios): color overlay via
UIViewwith the specified background color by @fonkamloic. - feat(macos): color overlay via
NSViewwith the specified background color by @fonkamloic. - feat(linux): color overlay state tracked and persisted (best-effort — compositors control task switcher thumbnails) by @fonkamloic.
- feat: color, blur, and image overlays are mutually exclusive — activating one deactivates the others, enforced at native level on all platforms by @fonkamloic.
- feat(example): added Color Overlay section with color picker and toggle button by @fonkamloic.
- feat(example): added localization strings for color overlay UI by @fonkamloic.
- test: added method channel, platform interface, and
NoScreenshottests fortoggleScreenshotWithBlurwith custom radius andtoggleScreenshotWithColorby @fonkamloic. - docs: updated README, CHANGELOG, roadmap, and example app to reflect configurable blur radius and color overlay support by @fonkamloic.
0.5.0 #
- feat: added
toggleScreenshotWithBlur()API — Gaussian blur overlay for app switcher / recents screen (P2) by @fonkamloic. - feat(android): blur overlay via
RenderEffect.createBlurEffect()on API 31+ (zero-copy GPU blur) andRenderScript.ScriptIntrinsicBluron API 17–30 by @fonkamloic. - feat(ios): blur overlay via
UIVisualEffectViewwithUIBlurEffect(style: .regular)by @fonkamloic. - feat(macos): blur overlay via
NSVisualEffectViewwith.hudWindowmaterial by @fonkamloic. - feat(linux): blur overlay state tracked and persisted (best-effort — compositors control task switcher thumbnails) by @fonkamloic.
- feat: blur and image overlay are mutually exclusive — activating one deactivates the other, enforced at native level on all platforms by @fonkamloic.
- feat: blur overlay state persists across app restarts via SharedPreferences / UserDefaults / JSON on all platforms by @fonkamloic.
- feat(example): added Overlay Blur section with toggle button and status indicator by @fonkamloic.
- fix(example): fixed stream subscription leak causing
setStateon unmounted widget — added properdispose()andmountedcheck by @fonkamloic. - test: added method channel, platform interface, and
NoScreenshottests fortoggleScreenshotWithBlurby @fonkamloic. - docs: updated README, CHANGELOG, roadmap, and example app to reflect blur overlay support by @fonkamloic.
0.4.0 #
- feat: detect screen recording start/stop events across all platforms (P1) by @fonkamloic.
- feat(ios): event-driven screen recording detection via
UIScreen.capturedDidChangeNotification(iOS 11+) — detects both start and stop by @fonkamloic. - feat(android): screen recording detection via
Activity.ScreenCaptureCallback(API 34+) — detects recording start; graceful no-op on pre-34 devices by @fonkamloic. - feat(macos): best-effort screen recording detection via
NSWorkspaceprocess monitoring — polls for known recording apps (QuickTime Player, OBS, Loom, Kap, ffmpeg, screencapture, simplescreenrecorder) by @fonkamloic. - feat(linux): best-effort screen recording detection via
/procprocess scanning — polls for known recording tools (ffmpeg, obs, simplescreenrecorder, kazam, peek, recordmydesktop, vokoscreen) by @fonkamloic. - feat: added
isScreenRecordingfield toScreenshotSnapshot— backward-compatible, defaults tofalsewhen omitted by native code by @fonkamloic. - feat: added
startScreenRecordingListening()andstopScreenRecordingListening()API methods — recording detection is independent of screenshot detection by @fonkamloic. - feat(example): added Recording Monitoring section with enable/disable buttons and real-time
isScreenRecordingstatus display by @fonkamloic. - test: added method channel, platform interface, and
ScreenshotSnapshottests for screen recording detection by @fonkamloic. - docs: updated README, CHANGELOG, roadmap, and example app to reflect screen recording detection support by @fonkamloic.
0.3.6 #
- feat(linux): added Linux support with screenshot detection via
GFileMonitor(inotify), monitoring~/Pictures/Screenshots/,~/Pictures/, and XDG pictures directory by @fonkamloic. - feat(linux): screenshot file path is available on Linux (via
GFileMonitor) — same as macOS by @fonkamloic. - feat(linux): screenshot prevention and image overlay are best-effort on Linux — state is tracked and persisted, but Linux compositors (Wayland / X11) do not expose a
FLAG_SECURE-equivalent API by @fonkamloic. - feat(linux): state persistence via JSON file in
$XDG_DATA_HOME/no_screenshot/state.jsonby @fonkamloic. - docs: updated README, CHANGELOG, and example app to reflect Linux support by @fonkamloic.
0.3.5 #
- fix(ios): fix iOS 26 RTL layout shift by dropping
ScreenProtectorKitand inlining screenshot prevention withforceLeftToRightsemantics by @fonkamloic. - fix(ios): fix
EXC_BAD_ACCESScrash in_collectExistingTraitCollectionsForTraitTrackingon iOS 26+ caused by circular view hierarchy by @fonkamloic. - fix(ios): fix bottom-right content alignment caused by Auto Layout constraint offset during layer reparenting by @fonkamloic.
- feat(ios): removed
ScreenProtectorKitdependency — all iOS screenshot prevention is now inlined by @fonkamloic. - feat(example): add EN/AR localization and RTL toggle to example app for testing RTL layout by @fonkamloic.
- docs: document
screenshotPathavailability — file path is only available on macOS; Android and iOS return a placeholder by @fonkamloic. - docs: add LTR/RTL language support note to README by @fonkamloic.
- docs: add GIF demo placeholders for every feature on every platform by @fonkamloic.
0.3.4 #
- fix(macos): detect clipboard-only screenshots (Cmd+Ctrl+Shift+3/4) via pasteboard polling by @fonkamloic.
- fix(macos): detect repeated screenshots while
screencaptureuiis still running by @fonkamloic. - fix(macos): track
screencaptureuiprocess lifecycle (launch + termination) for reliable detection by @fonkamloic. - fix(macos): add 2s debounce to suppress duplicate detection events while allowing file-path upgrades from
NSMetadataQueryby @fonkamloic. - docs: updated macOS screenshot monitoring documentation to reflect three detection methods by @fonkamloic.
0.3.3 #
- feat(macos): added macOS support for
toggleScreenshotWithImage()by @fonkamloic. - feat: added
toggleScreenshotWithImage()API to display a custom image overlay when the app goes to the background or app switcher, preventing screenshot content exposure on both Android and iOS by @zhangyuanyuan-bear and @fonkamloic. - feat: image overlay mode persists across app restarts via platform SharedPreferences/UserDefaults by @zhangyuanyuan-bear and @fonkamloic.
- fix(ios): prevent stale image overlay by consolidating lifecycle handling by @BranislavKljaic96 and @fonkamloic.
- fix(ios): native code now works with both SceneDelegate and AppDelegate by @BranislavKljaic96 in https://github.com/FlutterPlaza/no_screenshot/pull/86.
- fix: use
Executorsfor SharedPreferences access on Android to avoid strict mode violations on startup by @qk7b in https://github.com/FlutterPlaza/no_screenshot/pull/74. - fix: properly clean up image overlay and activity references on detach/config changes (Android) by @fonkamloic.
- chore: updated Kotlin and Gradle versions in Android build configuration by @T-moz in https://github.com/FlutterPlaza/no_screenshot/pull/76.
- chore: updated example app to demonstrate the new image overlay feature by @fonkamloic.
- test: added
toggleScreenshotWithImagetests and fixed CI codecov upload by @fonkamloic. - ci: added automated pub.dev publish workflow by @fonkamloic.
0.3.3-beta.1 #
- feat: added
toggleScreenshotWithImage()API to display a custom image overlay when the app goes to the background or app switcher, preventing screenshot content exposure on both Android and iOS by @zhangyuanyuan-bear and @fonkamloic. - feat: image overlay mode persists across app restarts via platform SharedPreferences/UserDefaults by @zhangyuanyuan-bear and @fonkamloic.
- fix: use
Executorsfor SharedPreferences access on Android to avoid strict mode violations on startup by @qk7b. - fix: properly clean up image overlay and activity references on detach/config changes (Android) by @fonkamloic.
- chore: updated Kotlin and Gradle versions in Android build configuration by @T-moz.
- chore: updated example app to demonstrate the new image overlay feature by @fonkamloic.
- ci: added automated pub.dev publish workflow by @fonkamloic.
0.3.2 #
- feat: macos support by @fonkamloic in https://github.com/FlutterPlaza/no_screenshot/pull/51
- fix: fix screenshot state not persisting on iOS by @fonkamloic in https://github.com/FlutterPlaza/no_screenshot/pull/45
- fix: duplicate interface definition for class 'NoScreenshotPlugin' by @fonkamloic in https://github.com/FlutterPlaza/no_screenshot/pull/62
- chore(deps): bump actions/checkout from 2 to 4 by @dependabot in https://github.com/FlutterPlaza/no_screenshot/pull/43
- chore(deps): bump codecov/codecov-action from 4.0.1 to 4.5.0 by @dependabot in https://github.com/FlutterPlaza/no_screenshot/pull/42
0.3.2-beta.3 #
- chore: updated pkg version by @fonkamloic in https://github.com/FlutterPlaza/no_screenshot/pull/63
- fix: duplicate interface definition for class 'NoScreenshotPlugin' by @fonkamloic in https://github.com/FlutterPlaza/no_screenshot/pull/62
0.3.2-beta.1 #
- fix: fix screenshot state not persisting on iOS by @fonkamloic in https://github.com/FlutterPlaza/no_screenshot/pull/45
- chore(deps): bump actions/checkout from 2 to 4 by @dependabot in https://github.com/FlutterPlaza/no_screenshot/pull/43
- chore(deps): bump codecov/codecov-action from 4.0.1 to 4.5.0 by @dependabot in https://github.com/FlutterPlaza/no_screenshot/pull/42
- feat: macos support by @fonkamloic in https://github.com/FlutterPlaza/no_screenshot/pull/51
0.3.1 #
- feat: added MacOS support
- fix: fix screenshot state not persisting on iOS
- chore: added more examples.
1.0.0-beta.2 #
- fix: Pub Point analysis failure.
1.0.0-beta.1 #
Summary of Changes #
- Automatic State Persistence: Removed the need to track
didChangeAppLifecycleState. The state will now be automatically persisted using native platform SharedPreferences. - Enhanced Example: Updated the example app to demonstrate the new automatic state persistence and usage of the
NoScreenshotplugin. - Stream Support: Provided a stream to listen for screenshot activities, making it easier to react to screenshots in real-time.
- Bug Fixes: Fixed various bugs related to screenshot detection and state management on both Android and iOS platforms.
- Documentation Updates: Improved documentation to reflect the new features and provide clearer usage examples.
- Deprecation Notice: Deprecated the use of the constructor
NoScreenshot()in favor of the singletonNoScreenshot.instance.
0.2.0 #
- Upgrade android to support AGP 8.X
- merged fix by @alberto-cappellina PR[https://github.com/FlutterPlaza/no_screenshot/pull/27]
- gradle:7.1.2 -> 7.4.2
- kotlin_version = '1.6.10' -> '1.6.21'
0.0.1+7 #
- Set the namespace for android
- Specify a more current version of ScreenProtectorKit. This resolves iOS17 issues.
- fix: screenshot prevention on iOS
- updated readme by @Musaddiq635 PR[https://github.com/FlutterPlaza/no_screenshot/pull/26]
- merged fix by @ggiordan PR[https://github.com/FlutterPlaza/no_screenshot/pull/29]
0.0.1+6 #
- Removed the non implemented override functions in android life-cycle
0.0.1+5 #
- Fixed broken link from pub dev analyses
0.0.1+4 #
- Fixed issue #1Crashes app when backgrounded on iOS
0.0.1+3 #
- Reverted to BSD 3 license
- Added documentation
- Made
NoScreenshotclass a singleton
0.0.1+2 #
- Adopted MIT license
0.0.1+1 #
Updated readme and added sample usage.
0.0.1 #
Package has 3 basic functionalities on android and IOS via method channel. - Disable screenshot support in app - Enable screenshot support in app - Toggle between enable and disable state