flutter_rotation_sensor
0.4.1, released 9 days ago by an unverified publisher
Provides a stream of device orientation data including rotation matrix, quaternion, and Euler angles.
What it does
The flutter_rotation_sensor plugin gives real-time access to a device's physical orientation on Android, iOS, and supported web browsers. It provides data in three representations: rotation matrix, quaternion, and Euler angles (azimuth, pitch, roll), with customizable update intervals and reference frames.
AI-written summary of version 0.4.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need real-time tracking of device orientation or movement in space.
- Building augmented reality, navigation, or gaming applications requiring compass and rotation data.
Skip it when
- Targeting platforms where rotation sensors are not supported.
- You only require simple device info without sensor orientation streams.
Strengths
- Supports multiple formats: rotation matrix, quaternion, and Euler angles.
- Cross-platform support including Android, iOS, and web browsers.
- Customizable update intervals and coordinate system remapping.
Weaknesses
- Web platform may require explicit permission handling via user gestures.
- Depends on hardware capabilities and browser Sensor API support.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 5
No special native permissions required for Android and iOS; web requires runtime permission flows on browsers that enforce them.
StreamBuilder(
stream: RotationSensor.orientationStream,
builder: (context, snapshot) {
if (snapshot.hasData) {
final data = snapshot.data!;
return Text('Azimuth: ${data.eulerAngles.azimuth}');
} else if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
}
return const CircularProgressIndicator();
},
)Alternatives
Packages that do the same job and could replace flutter_rotation_sensor.
- sensors_plus
If you need broader access to standard accelerometer, magnetometer, gyroscope, and user acceleration sensors.
96Compare
Works with
Packages commonly used together with flutter_rotation_sensor: ones it builds on, ones built on it, and its own family.
- webflutter_rotation_sensor depends on itLightweight bindings for browser APIs via JS interop
- intlflutter_rotation_sensor depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- plugin_platform_interfaceflutter_rotation_sensor depends on itReusable base class for platform interfaces of Flutter federated plugins.
- native_device_orientationflutter_rotation_sensor depends on itA Flutter plugin for reading native device orientation from UI or sensors.
- flutter_map_location_markerBuilt on flutter_rotation_sensorA flutter_map plugin for displaying the device's current location with a customizable marker.