Skip to content
pubscout

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.

WASM-ready
$ flutter pub add flutter_rotation_sensor
Source repository

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.

Works with

Packages commonly used together with flutter_rotation_sensor: ones it builds on, ones built on it, and its own family.