flutter_device_compass
2.2.0, released 3 months ago by an unverified publisher
A Flutter compass plugin using device sensors to provide real-time heading and accuracy.
What it does
Provides real-time device heading in degrees (0-360) using built-in device sensors. It automatically compensates for device orientation changes, offers camera-mode heading for augmented reality, and exposes sensor accuracy and hardware availability.
AI-written summary of version 2.2.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to build a compass or directional UI in Flutter.
- Your application requires augmented reality or camera-mode orientation headings.
- You need orientation-compensated heading readings from device sensors.
Skip it when
- The target devices lack physical compass or rotation sensors.
- You only require standard geolocation coordinates without magnetic heading.
Strengths
- Orientation-aware and automatically compensates for device rotation changes.
- Exposes camera-mode heading for AR or camera overlays.
- Tunable update presets to balance smoothness and battery consumption.
Weaknesses
- Requires platform-specific location permissions on iOS.
- Depends on physical hardware sensors which are not available on all devices.
Setup
- Kind
- Plugin (native code)
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
iOS requires location permission strings in Info.plist. Android usage of fine location is optional depending on features.
import 'package:flutter_device_compass/flutter_device_compass.dart';
final subscription = FlutterCompass.events?.listen((CompassEvent event) {
print('Heading: ${event.heading}°');
});Alternatives
Packages that do the same job and could replace flutter_device_compass.
- sensors_plus
Provides raw accelerometer, gyroscope, and magnetometer sensor streams if you need to build custom sensor processing instead of a dedicated compass.
96Compare