is_lock_screen2 2.1.0 copy "is_lock_screen2: ^2.1.0" to clipboard
is_lock_screen2: ^2.1.0 copied to clipboard

Detects if device is in lock screen. Useful for determining whether app entered background due to locking screen or leaving app.

2.1.0 - 2026-06-30 #

  • Added isLockScreenOrThrow() and IsLockScreenException so callers can distinguish missing plugin registration, platform errors, and unexpected null platform responses.
  • Kept isLockScreen() compatible with previous releases by returning null for all failure modes.
  • Added Swift Package Manager (SPM) support for iOS (Flutter 3.44+ default build system).
  • Updated podspec iOS minimum to 12.0 (required by SPM).
  • Updated Android Gradle Plugin to 8.6.1 and Gradle wrappers to 8.7 so the Android build chain officially supports API 35.
  • Replaced deprecated Android Gradle DSL entries and removed obsolete android.enableR8 properties.
  • Increased the Gradle heap size used by the plugin and example Android builds to avoid Jetifier transform out-of-memory failures.

2.0.5 - 2026-06-12 #

  • Improved the iOS lock-screen heuristic by combining protected data availability, protected data notifications, and screen brightness.
  • Added Dart MethodChannel tests for true, false, null, platform exceptions, and missing plugin registration.
  • Cleaned up analyzer hints in the example app and adjusted .gitignore for release packaging.
  • Documented that iOS does not provide a stable public lock-screen state API, so iOS detection remains heuristic and should not be treated as a security source of truth.

2.0.4 - 2025-09-17 #

  • Updated the .gitignore file, added Android build-related directories, and the pubspec.lock file.
  • Updated compileSdkVersion from 34 to 35, Java version from 1.8 to 11, and Kotlin version from jdk7 to jdk8 in build.gradle.
  • Updated example/android/build.gradle to remove jcenter() and update Kotlin version to 2.1.0.
  • Added pluginManagement to settings.gradle to configure the Flutter SDK path.
  • Added plugin declarations to app/build.gradle and updated compileSdkVersion and targetSdkVersion to 35.
  • Updated dependency versions in pubspec.lock to ensure compatibility with the latest Dart and Flutter SDKs.
  • Deleted the MainActivity.kt file to simplify the project structure.

2.0.3 - 2025-04-08 #

  • removing name space from AndroidManifest.xml and moving it to build.gradle
  • upgrading gradle version to 8.4
  • removing the registerWith, it's no longer needed in the new FlutterPlugin

2.0.2 - 2025-02-24 #

  • updating the min and the target sdk and the kotlin version

2.0.1 2023-7-23 #

  • Update Android Gradle

2.0.0 - 2021-04-08 #

  • Support null safety

  • Clean up unused code and debug prints in iOS native part

  • Update and and clean up example code

1.0.0 - 2020-07-16 #

  • Initial release
8
likes
160
points
3.34k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Detects if device is in lock screen. Useful for determining whether app entered background due to locking screen or leaving app.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on is_lock_screen2

Packages that implement is_lock_screen2