Skip to content

Commit fa2e5fd

Browse files
committed
version 1.3.0 optional screen on/off (android)
1 parent 14ae49c commit fa2e5fd

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33

44
.packages
55
.pub/
6+
android/.idea/
67

78
build/

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
## 1.3.0
2+
- documentation
3+
- enable the screen off behavior on Android (optional)
4+
15
## 1.2.0
26
- revert : turn off screen on Android while listening for proximity events
3-
7+
-
48
## 1.1.0
59
- turn off screen on Android while listening for proximity events
610

example/lib/main.dart

+5
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ class _MyAppState extends State<MyApp> {
3737
FlutterError.dumpErrorToConsole(details);
3838
}
3939
};
40+
41+
// --------------------------------------------------------------------
42+
// You only need to make this call if you want to turn off the screen.
4043
await ProximitySensor.setProximityScreenOff(true).onError((error, stackTrace) {
4144
print("could not enable screen off functionality");
4245
return null;
4346
});
47+
// --------------------------------------------------------------------
48+
4449
_streamSubscription = ProximitySensor.events.listen((int event) {
4550
setState(() {
4651
_isNear = (event > 0) ? true : false;

example/pubspec.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ packages:
4545
dependency: "direct main"
4646
description:
4747
name: cupertino_icons
48-
sha256: caac504f942f41dfadcf45229ce8c47065b93919a12739f20d6173a883c5ec73
48+
sha256: d57953e10f9f8327ce64a508a355f0b1ec902193f66288e8cb5070e7c47eeb2d
4949
url: "https://pub.dev"
5050
source: hosted
51-
version: "1.0.2"
51+
version: "1.0.6"
5252
fake_async:
5353
dependency: transitive
5454
description:

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: proximity_sensor
22
description: simple and easy to use flutter plugin package for proximity sensor (only)
3-
version: 1.2.0
3+
version: 1.3.0
44
homepage: https://github.com/jeremyko/flutter-proximity-sensor-plugin
55

66
environment:

0 commit comments

Comments
 (0)