unlock_detector 0.0.4 copy "unlock_detector: ^0.0.4" to clipboard
unlock_detector: ^0.0.4 copied to clipboard

A Flutter Package to detect if app running while phone is locked or not.

Unlock Detector Plugin for Flutter #

Pub Package

This Flutter plugin allows you to detect screen lock and unlock events on both Android and iOS devices.

Features #

  • Detect when the screen is locked or unlocked.

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  unlock_detector:

Usage #

  final UnlockDetector _unlockDetector = UnlockDetector();
  String _status = 'Unknown';

    _unlockDetector.startDetection();
    _unlockDetector.lockUnlockStream?.listen((event) {
      setState(() {
        _status = event;
      });
    });

    ...
        body: Center(
          child: Text('Lock/Unlock Status: $_status'),
        ),
           ...

Support #

If you find this plugin helpful, consider supporting me:

Buy Me A Coffee

5
likes
0
points
55
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter Package to detect if app running while phone is locked or not.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on unlock_detector