screen_off 1.0.0 copy "screen_off: ^1.0.0" to clipboard
screen_off: ^1.0.0 copied to clipboard

A Flutter plugin to turn on and off the screen using the proximity sensor.

screen_off #

A Flutter plugin to programmatically turn the screen off or on using the proximity sensor. This is especially useful for custom calling apps or scenarios where the screen needs to be turned off when the device is close to the user.

Features #

  • πŸ“΄ Turn screen off using proximity sensor
  • ⚑ Turn screen back on when the sensor is no longer triggered
  • πŸ”Œ Easy to integrate into any Flutter app
  • βœ… Works on both Android and iOS

Usage #

Android #

Add the following permission to your AndroidManifest.xml if needed:

<uses-permission android:name="android.permission.WAKE_LOCK"/>

iOS #

No additional setup is required for iOS. Just make sure the app has permission to access the proximity sensor (enabled by default).

Flutter #

import 'package:screen_off/screen_off.dart';

/// Turn screen off
await ScreenOff.turnScreenOff();

/// Turn screen on
await ScreenOff.turnScreenOn();

Platform #

Platform Support
Android βœ…
iOS βœ…

Installation #

Add this to your pubspec.yaml:

dependencies:
  screen_off: <latest_version>

Then run:

flutter pub get

If you find it useful, a ⭐ on GitHub is appreciated.

Maintainer #

Developed and maintained by Musaddiq625

Contributing #

πŸ€” Something broken? Got a better way to do it?
Don’t be shy - I’d love your contribution. Every PR will make this project stronger! πŸ’ͺ🏻

License #

This project is licensed under the MIT License - see the LICENSE file for details.


🩡 Sponsors #

Show your appreciation to our sponsors:

4
likes
150
points
2.35k
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin to turn on and off the screen using the proximity sensor.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on screen_off

Packages that implement screen_off