You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Flutter plugin to access the accelerometer, gyroscope, magnetometer and
9
+
A Flutter plugin to access the accelerometer, gyroscope, magnetometer and
10
10
barometer sensors.
11
11
12
12
## Platform Support
@@ -23,15 +23,15 @@ barometer sensors.
23
23
- Dart >=3.3.0 <4.0.0
24
24
- iOS >=12.0
25
25
- macOS >=10.14
26
-
- Android `compileSDK` 34
27
26
- Java 17
28
-
- Android Gradle Plugin >=8.3.0
29
-
- Gradle wrapper >=8.4
27
+
- Kotlin 2.2.0
28
+
- Android Gradle Plugin >=8.12.1
29
+
- Gradle wrapper >=8.13
30
30
31
31
## Usage
32
32
33
33
Add `sensors_plus` as a dependency in your pubspec.yaml file.
34
-
34
+
35
35
On iOS you must also include a key called [`NSMotionUsageDescription`](https://developer.apple.com/documentation/bundleresources/information_property_list/nsmotionusagedescription) in your app's `Info.plist` file. This key provides a message that tells the user why the app is requesting access to the device’s motion data. The plugin itself needs access to motion data to get barometer data.
36
36
37
37
Example Info.plist entry:
@@ -67,7 +67,7 @@ The plugin exposes such classes of sensor events through a set of streams:
67
67
-`GyroscopeEvent` describes the rotation of the device.
68
68
-`MagnetometerEvent` describes the ambient magnetic field surrounding the
69
69
device. A compass is an example usage of this data.
70
-
-`BarometerEvent` describes the atmospheric pressure surrounding the device, in hPa.
70
+
-`BarometerEvent` describes the atmospheric pressure surrounding the device, in hPa.
71
71
An altimeter is an example usage of this data. Not supported on web browsers.
72
72
73
73
These events are exposed through a `BroadcastStream`: `accelerometerEvents`,
@@ -173,27 +173,27 @@ sensor data.
173
173
174
174
### Platform Restrictions and Considerations
175
175
176
-
The following lists the restrictions for the sensors on certain platforms due to limitations of the platform.
176
+
The following lists the restrictions for the sensors on certain platforms due to limitations of the platform.
177
177
178
178
-**Magnetometer and Barometer missing for web**
179
179
180
-
The Magnetometer API is currently not supported by any modern web browsers. Check browser compatibility matrix on [MDN docs for Magnetormeter API](https://developer.mozilla.org/en-US/docs/Web/API/Magnetometer).
180
+
The Magnetometer API is currently not supported by any modern web browsers. Check browser compatibility matrix on [MDN docs for Magnetormeter API](https://developer.mozilla.org/en-US/docs/Web/API/Magnetometer).
181
181
182
-
The Barometer API does not exist for web platforms as can be seen at [MDN docs forn Sensors API](https://developer.mozilla.org/en-US/docs/Web/API/Sensor_APIs).
182
+
The Barometer API does not exist for web platforms as can be seen at [MDN docs forn Sensors API](https://developer.mozilla.org/en-US/docs/Web/API/Sensor_APIs).
183
183
184
-
Developers should consider alternative methods or inform users about the limitation when their application runs on a web platform.
184
+
Developers should consider alternative methods or inform users about the limitation when their application runs on a web platform.
185
185
186
186
> [!NOTE]
187
187
>
188
188
> Plugin won't crash the app in the case of usage on these platforms, but it is highly recommended to add onError() to handle such cases gracefully.
189
189
190
190
-**Sampling periods for web**
191
191
192
-
Currently it is not possible to set sensors sampling rate on web. Calls to event streams at specied sampling periods will have the sampling period ignored.
192
+
Currently it is not possible to set sensors sampling rate on web. Calls to event streams at specied sampling periods will have the sampling period ignored.
193
193
194
194
-**Barometer sampling period limitation for iOS**
195
195
196
-
On iOS devices, barometer updates are [CMAltimeter](https://developer.apple.com/documentation/coremotion/cmaltimeter) which provides updates at regular intervals that cannot be controlled by the user. Calls to `barometerEventStream` at specied sampling periods will have the sampling period ignored.
196
+
On iOS devices, barometer updates are [CMAltimeter](https://developer.apple.com/documentation/coremotion/cmaltimeter) which provides updates at regular intervals that cannot be controlled by the user. Calls to `barometerEventStream` at specied sampling periods will have the sampling period ignored.
0 commit comments