screen_lock_detector 2.0.0
screen_lock_detector: ^2.0.0 copied to clipboard
A Flutter plugin to detect screen lock/unlock events across Android and iOS platforms.
Changelog #
2.0.0 #
- Updates minimum supported SDK version to Flutter 3.44 / Dart 3.12
- Migrates Android to Flutter 3.44 built-in Kotlin support
- Adds
FlutterFrameworkdependency and improves tests on iOS - Fix iOS:
NotificationCenterobservers are now removed indeinitto prevent crash and duplicate events on engine detach / add-to-app - Fix iOS:
checkScreenStatus()initial value changed fromUNLOCKEDtoUNKNOWNso the first real lock/unlock notification is never suppressed - Fix Android:
BroadcastReceiveris now guarded against double-registration when the stream is resubscribed - Fix Android:
onCancelnow safely handles unregistering a never-registered receiver - Fix Android: null
appContextinonListennow surfaces an error instead of silently dropping receiver registration - BREAKING:
ScreenStatus.namerenamed toScreenStatus.valueto stop shadowing Dart's built-inEnum.name
1.0.0 #
- Detect when the screen is locked
- Detect when the screen is unlocked
- Supports both event streams and manual status checks
- Works on Android and iOS
