proximity_screen_lock 2.2.0
proximity_screen_lock: ^2.2.0 copied to clipboard
A plugin that can be used to bind screen activation to proximity sensor
Proximity Screen Lock #
A Flutter plugin that can be used to bind screen activation to proximity sensor and detect proximity events
Usage #
To activate the behavior
if (ProximityLockScreen.isProximityLockSupported()) {
ProximityLockScreen.setActive(true);
ProximityScreenLock.proximityStates.listen((objectDetected) async {
print(objectDetected ? 'Object detected' : 'No object detected');
});
}
Availability #
ProximityLockScreen.isProximityLockAvailable()
will return false
on Android devices that do not provide a proximity sensor.
It will also return false
for non-mobile devices
iOS | Android | Others | |
---|---|---|---|
isProximityLockAvailable |
true |
true or false |
false |