proximity_screen_lock
2.3.0, released 6 months ago by mantoux.org
Bind screen activation to proximity sensor and detect proximity events in Flutter.
What it does
A Flutter plugin that binds screen activation to the device proximity sensor. It allows detecting proximity events and checking if proximity locking is supported or available on the current device.
AI-written summary of version 2.3.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to turn off or lock the screen when an object is close to the proximity sensor
- You need to listen to proximity sensor state changes on mobile devices
Skip it when
- You are building for non-mobile platforms where proximity sensors are absent
- You need general sensor access beyond proximity
Strengths
- Simple API to toggle active proximity locking
- Provides stream of proximity states
- Checks sensor availability for iOS and Android
Weaknesses
- Not supported on non-mobile platforms
- Availability depends on hardware support on Android
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 3
not documented
if (ProximityLockScreen.isProximityLockSupported()) {
ProximityLockScreen.setActive(true);
ProximityScreenLock.proximityStates.listen((objectDetected) async {
print(objectDetected ? 'Object detected' : 'No object detected');
});
}Alternatives
Packages that do the same job and could replace proximity_screen_lock.
- proximity_sensor
Flutter plugin to read proximity sensor events on Android and iOS
70Compare - flutter_overlay_window
Flutter plugin to display your app over other apps on the screen.
85Compare - screen_corner_radius
Provides the corner radius value of the current device screen for Android and iOS.
47Compare - flutter_screen_wake
Manage device screen wake state and brightness on Android and iOS.
40Compare