v2.0.0
Breaking release. Two things to check before upgrading from 1.2.0:
- Prevention is now tracked as two separate claims —
screenshotOff()/screenshotOn()/toggleScreenshot()own an independent claim, and an active app-switcher overlay mode holds its own claim. Protection stays engaged while either claim is held. Apps that use only one of the two APIs behave exactly as before; sequences that mix them now resolve fail-secure instead of silently dropping protection. To fully disable protection, release both claims — e.g.overlayOff()+screenshotOn()(whatSecureWidget/applyOverlayMode(OverlayMode.none)do). - The minimum Flutter version is now 3.44 (Dart 3.12).
What's new
- 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). - feat (behavior change): the two-claim prevention model described above, on every platform. No API signatures changed. The persisted state gains an
independent_preventionkey; state written by older versions is migrated automatically (one-shot) on first launch. - fix:
SecureWidgetteardown,applyOverlayMode(OverlayMode.none), andapplyOverlayMode(OverlayMode.secure)now clear any active overlay mode — a disposedSecureWidget(mode: OverlayMode.blur)no longer keeps 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). - fix(android): the plugin's build script no longer applies the Kotlin Gradle Plugin, completing the Built-in Kotlin migration and removing Flutter's "plugins that apply KGP" build warning (#120). Kotlin is provided by the Flutter tool itself: AGP's built-in Kotlin on AGP 9+, auto-applied KGP on older AGP versions.
Notes
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, usescreenshotOff()/screenshotOn()explicitly instead of mixing it withtoggleScreenshot().- Full details: CHANGELOG
- On pub.dev: https://pub.dev/packages/no_screenshot/versions/2.0.0