Skip to content

v2.0.0

Choose a tag to compare

@fonkamloic fonkamloic released this 08 Aug 19:33
· 11 commits to development since this release
dd4ecfa

Breaking release. Two things to check before upgrading from 1.2.0:

  1. Prevention is now tracked as two separate claimsscreenshotOff()/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() (what SecureWidget / applyOverlayMode(OverlayMode.none) do).
  2. 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_prevention key; state written by older versions is migrated automatically (one-shot) on first launch.
  • fix: SecureWidget teardown, applyOverlayMode(OverlayMode.none), and applyOverlayMode(OverlayMode.secure) now clear any active overlay mode — a disposed SecureWidget(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 sets FLAG_SECURE (or the platform equivalent) outside this plugin, use screenshotOff()/screenshotOn() explicitly instead of mixing it with toggleScreenshot().
  • Full details: CHANGELOG
  • On pub.dev: https://pub.dev/packages/no_screenshot/versions/2.0.0