Skip to content

Commit 83bdf1b

Browse files
jeremykojeremyko
jeremyko
authored andcommitted
android only feature
1 parent 2088296 commit 83bdf1b

14 files changed

+170
-44
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.3.6
2+
- android only feature
3+
14
## 1.3.5
25
- minSdkVersion 23
36

example/.metadata

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,27 @@
44
# This file should be version controlled and should not be manually edited.
55

66
version:
7-
revision: 4d7946a68d26794349189cf21b3f68cc6fe61dcb
8-
channel: stable
7+
revision: "68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3"
8+
channel: "stable"
99

1010
project_type: app
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3
17+
base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3
18+
- platform: web
19+
create_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3
20+
base_revision: 68415ad1d920f6fe5ec284f5c2febf7c4dd5b0b3
21+
22+
# User provided section
23+
24+
# List of Local paths (relative to this file) that should be
25+
# ignored by the migrate tool.
26+
#
27+
# Files that are not part of the templates will be ignored by default.
28+
unmanaged_files:
29+
- 'lib/main.dart'
30+
- 'ios/Runner.xcodeproj/project.pbxproj'

example/analysis_options.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This file configures the analyzer, which statically analyzes Dart code to
2+
# check for errors, warnings, and lints.
3+
#
4+
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5+
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6+
# invoked from the command line by running `flutter analyze`.
7+
8+
# The following line activates a set of recommended lints for Flutter apps,
9+
# packages, and plugins designed to encourage good coding practices.
10+
include: package:flutter_lints/flutter.yaml
11+
12+
linter:
13+
# The lint rules applied to this project can be customized in the
14+
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
15+
# included above or to enable additional rules. A list of all available lints
16+
# and their documentation is published at https://dart.dev/lints.
17+
#
18+
# Instead of disabling a lint rule for the entire project in the
19+
# section below, it can also be suppressed for a single line of code
20+
# or a specific dart file by using the `// ignore: name_of_lint` and
21+
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
22+
# producing the lint.
23+
rules:
24+
# avoid_print: false # Uncomment to disable the `avoid_print` rule
25+
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26+
27+
# Additional information about this file can be found at
28+
# https://dart.dev/guides/language/analysis-options

example/lib/main.dart

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter/foundation.dart' as foundation;
33
import 'dart:async';
4+
import 'dart:io' show Platform;
45
import 'package:proximity_sensor/proximity_sensor.dart';
56

67
////////////////////////////////////////////////////////////////////////////////
@@ -40,14 +41,15 @@ class _MyAppState extends State<MyApp> {
4041

4142
// -------------------------------------------------------------------- <!!! ANDROID ONLY !!!>
4243
// This doesn't work on ios or web. Don't call it.
43-
// You only need to make this call if you want to turn off the screen.
44-
// Add below permission in your AndroidManifest.xml file.
45-
// <uses-permission android:name="android.permission.WAKE_LOCK"/>
46-
47-
await ProximitySensor.setProximityScreenOff(true).onError((error, stackTrace) {
48-
print("could not enable screen off functionality");
49-
return null;
50-
});
44+
if (Platform.isAndroid) {
45+
// You only need to make this call if you want to turn off the screen.
46+
// Add below permission in your AndroidManifest.xml file.
47+
// <uses-permission android:name="android.permission.WAKE_LOCK"/>
48+
await ProximitySensor.setProximityScreenOff(true).onError((error, stackTrace) {
49+
print("could not enable screen off functionality");
50+
return null;
51+
});
52+
}
5153
// -------------------------------------------------------------------- <!!! ANDROID ONLY !!!>
5254

5355
_streamSubscription = ProximitySensor.events.listen((int event) {

example/pubspec.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ packages:
3737
dependency: transitive
3838
description:
3939
name: collection
40-
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
40+
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
4141
url: "https://pub.dev"
4242
source: hosted
43-
version: "1.18.0"
43+
version: "1.19.0"
4444
cupertino_icons:
4545
dependency: "direct main"
4646
description:
@@ -71,18 +71,18 @@ packages:
7171
dependency: transitive
7272
description:
7373
name: leak_tracker
74-
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
74+
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
7575
url: "https://pub.dev"
7676
source: hosted
77-
version: "10.0.5"
77+
version: "10.0.7"
7878
leak_tracker_flutter_testing:
7979
dependency: transitive
8080
description:
8181
name: leak_tracker_flutter_testing
82-
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
82+
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
8383
url: "https://pub.dev"
8484
source: hosted
85-
version: "3.0.5"
85+
version: "3.0.8"
8686
leak_tracker_testing:
8787
dependency: transitive
8888
description:
@@ -129,12 +129,12 @@ packages:
129129
path: ".."
130130
relative: true
131131
source: path
132-
version: "1.3.4"
132+
version: "1.3.5"
133133
sky_engine:
134134
dependency: transitive
135135
description: flutter
136136
source: sdk
137-
version: "0.0.99"
137+
version: "0.0.0"
138138
source_span:
139139
dependency: transitive
140140
description:
@@ -147,10 +147,10 @@ packages:
147147
dependency: transitive
148148
description:
149149
name: stack_trace
150-
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
150+
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
151151
url: "https://pub.dev"
152152
source: hosted
153-
version: "1.11.1"
153+
version: "1.12.0"
154154
stream_channel:
155155
dependency: transitive
156156
description:
@@ -163,10 +163,10 @@ packages:
163163
dependency: transitive
164164
description:
165165
name: string_scanner
166-
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
166+
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
167167
url: "https://pub.dev"
168168
source: hosted
169-
version: "1.2.0"
169+
version: "1.3.0"
170170
term_glyph:
171171
dependency: transitive
172172
description:
@@ -179,10 +179,10 @@ packages:
179179
dependency: transitive
180180
description:
181181
name: test_api
182-
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
182+
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
183183
url: "https://pub.dev"
184184
source: hosted
185-
version: "0.7.2"
185+
version: "0.7.3"
186186
vector_math:
187187
dependency: transitive
188188
description:
@@ -195,10 +195,10 @@ packages:
195195
dependency: transitive
196196
description:
197197
name: vm_service
198-
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
198+
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
199199
url: "https://pub.dev"
200200
source: hosted
201-
version: "14.2.5"
201+
version: "14.3.0"
202202
sdks:
203-
dart: ">=3.3.0 <4.0.0"
203+
dart: ">=3.4.0 <4.0.0"
204204
flutter: ">=3.18.0-18.0.pre.54"

example/web/favicon.png

917 Bytes
Loading

example/web/icons/Icon-192.png

5.17 KB
Loading

example/web/icons/Icon-512.png

8.06 KB
Loading
5.46 KB
Loading
20.5 KB
Loading

example/web/index.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<!--
5+
If you are serving your web app in a path other than the root, change the
6+
href value below to reflect the base path you are serving from.
7+
8+
The path provided below has to start and end with a slash "/" in order for
9+
it to work correctly.
10+
11+
For more details:
12+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
13+
14+
This is a placeholder for base href that will be replaced by the value of
15+
the `--base-href` argument provided to `flutter build`.
16+
-->
17+
<base href="$FLUTTER_BASE_HREF">
18+
19+
<meta charset="UTF-8">
20+
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
21+
<meta name="description" content="A new Flutter project.">
22+
23+
<!-- iOS meta tags & icons -->
24+
<meta name="mobile-web-app-capable" content="yes">
25+
<meta name="apple-mobile-web-app-status-bar-style" content="black">
26+
<meta name="apple-mobile-web-app-title" content="proximity_sensor_example">
27+
<link rel="apple-touch-icon" href="icons/Icon-192.png">
28+
29+
<!-- Favicon -->
30+
<link rel="icon" type="image/png" href="favicon.png"/>
31+
32+
<title>proximity_sensor_example</title>
33+
<link rel="manifest" href="manifest.json">
34+
</head>
35+
<body>
36+
<script src="flutter_bootstrap.js" async></script>
37+
</body>
38+
</html>

example/web/manifest.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "proximity_sensor_example",
3+
"short_name": "proximity_sensor_example",
4+
"start_url": ".",
5+
"display": "standalone",
6+
"background_color": "#0175C2",
7+
"theme_color": "#0175C2",
8+
"description": "A new Flutter project.",
9+
"orientation": "portrait-primary",
10+
"prefer_related_applications": false,
11+
"icons": [
12+
{
13+
"src": "icons/Icon-192.png",
14+
"sizes": "192x192",
15+
"type": "image/png"
16+
},
17+
{
18+
"src": "icons/Icon-512.png",
19+
"sizes": "512x512",
20+
"type": "image/png"
21+
},
22+
{
23+
"src": "icons/Icon-maskable-192.png",
24+
"sizes": "192x192",
25+
"type": "image/png",
26+
"purpose": "maskable"
27+
},
28+
{
29+
"src": "icons/Icon-maskable-512.png",
30+
"sizes": "512x512",
31+
"type": "image/png",
32+
"purpose": "maskable"
33+
}
34+
]
35+
}

pubspec.lock

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ packages:
3737
dependency: transitive
3838
description:
3939
name: collection
40-
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
40+
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
4141
url: "https://pub.dev"
4242
source: hosted
43-
version: "1.18.0"
43+
version: "1.19.0"
4444
fake_async:
4545
dependency: transitive
4646
description:
@@ -63,18 +63,18 @@ packages:
6363
dependency: transitive
6464
description:
6565
name: leak_tracker
66-
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
66+
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
6767
url: "https://pub.dev"
6868
source: hosted
69-
version: "10.0.5"
69+
version: "10.0.7"
7070
leak_tracker_flutter_testing:
7171
dependency: transitive
7272
description:
7373
name: leak_tracker_flutter_testing
74-
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
74+
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
7575
url: "https://pub.dev"
7676
source: hosted
77-
version: "3.0.5"
77+
version: "3.0.8"
7878
leak_tracker_testing:
7979
dependency: transitive
8080
description:
@@ -119,7 +119,7 @@ packages:
119119
dependency: transitive
120120
description: flutter
121121
source: sdk
122-
version: "0.0.99"
122+
version: "0.0.0"
123123
source_span:
124124
dependency: transitive
125125
description:
@@ -132,10 +132,10 @@ packages:
132132
dependency: transitive
133133
description:
134134
name: stack_trace
135-
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
135+
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
136136
url: "https://pub.dev"
137137
source: hosted
138-
version: "1.11.1"
138+
version: "1.12.0"
139139
stream_channel:
140140
dependency: transitive
141141
description:
@@ -148,10 +148,10 @@ packages:
148148
dependency: transitive
149149
description:
150150
name: string_scanner
151-
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
151+
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
152152
url: "https://pub.dev"
153153
source: hosted
154-
version: "1.2.0"
154+
version: "1.3.0"
155155
term_glyph:
156156
dependency: transitive
157157
description:
@@ -164,10 +164,10 @@ packages:
164164
dependency: transitive
165165
description:
166166
name: test_api
167-
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
167+
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
168168
url: "https://pub.dev"
169169
source: hosted
170-
version: "0.7.2"
170+
version: "0.7.3"
171171
vector_math:
172172
dependency: transitive
173173
description:
@@ -180,10 +180,10 @@ packages:
180180
dependency: transitive
181181
description:
182182
name: vm_service
183-
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
183+
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
184184
url: "https://pub.dev"
185185
source: hosted
186-
version: "14.2.5"
186+
version: "14.3.0"
187187
sdks:
188-
dart: ">=3.3.0 <4.0.0"
188+
dart: ">=3.4.0 <4.0.0"
189189
flutter: ">=3.18.0-18.0.pre.54"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
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.3.5
3+
version: 1.3.6
44
homepage: https://github.com/jeremyko/flutter-proximity-sensor-plugin
55

66
environment:

0 commit comments

Comments
 (0)